ma-agents 1.2.0 → 1.3.0
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/bin/cli.js +19 -11
- package/lib/agents.js +14 -7
- package/lib/installer.js +2 -2
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -22,6 +22,7 @@ ${chalk.bold('Usage:')}
|
|
|
22
22
|
${chalk.cyan(`npx ${NAME} help`)} Show this help
|
|
23
23
|
|
|
24
24
|
${chalk.bold('Install options:')}
|
|
25
|
+
${chalk.cyan('--global')} Install to global/user-level paths (default: project-level)
|
|
25
26
|
${chalk.cyan('--path <dir>')} Custom installation directory
|
|
26
27
|
|
|
27
28
|
${chalk.bold('Examples:')}
|
|
@@ -104,20 +105,24 @@ async function installWizard(preselectedSkill, preselectedAgents, customPath) {
|
|
|
104
105
|
selectedAgentIds = chosen;
|
|
105
106
|
}
|
|
106
107
|
|
|
107
|
-
// Step 3:
|
|
108
|
+
// Step 3: Installation scope (project vs global)
|
|
108
109
|
let installPath = customPath || '';
|
|
110
|
+
let installScope = 'project';
|
|
109
111
|
if (!installPath) {
|
|
110
112
|
const { pathChoice } = await prompts({
|
|
111
113
|
type: 'select',
|
|
112
114
|
name: 'pathChoice',
|
|
113
|
-
message: 'Installation
|
|
115
|
+
message: 'Installation scope:',
|
|
114
116
|
choices: [
|
|
115
|
-
{ title: '
|
|
117
|
+
{ title: 'Project level (current directory)', value: 'project' },
|
|
118
|
+
{ title: 'Global (user-level settings)', value: 'global' },
|
|
116
119
|
{ title: 'Custom path...', value: 'custom' }
|
|
117
120
|
]
|
|
118
121
|
});
|
|
119
122
|
|
|
120
|
-
if (pathChoice === '
|
|
123
|
+
if (pathChoice === 'global') {
|
|
124
|
+
installScope = 'global';
|
|
125
|
+
} else if (pathChoice === 'custom') {
|
|
121
126
|
const { customDir } = await prompts({
|
|
122
127
|
type: 'text',
|
|
123
128
|
name: 'customDir',
|
|
@@ -133,7 +138,7 @@ async function installWizard(preselectedSkill, preselectedAgents, customPath) {
|
|
|
133
138
|
console.log(chalk.bold(' Summary:'));
|
|
134
139
|
console.log(chalk.cyan(' Skills: ') + selectedSkillIds.join(', '));
|
|
135
140
|
console.log(chalk.cyan(' Agents: ') + selectedAgentIds.join(', '));
|
|
136
|
-
console.log(chalk.cyan(' Path: ') + (installPath || '
|
|
141
|
+
console.log(chalk.cyan(' Path: ') + (installPath || (installScope === 'global' ? 'global (user-level)' : 'project (current directory)')));
|
|
137
142
|
console.log('');
|
|
138
143
|
|
|
139
144
|
const { confirmed } = await prompts({
|
|
@@ -151,7 +156,7 @@ async function installWizard(preselectedSkill, preselectedAgents, customPath) {
|
|
|
151
156
|
// Step 5: Install each skill
|
|
152
157
|
for (const skillId of selectedSkillIds) {
|
|
153
158
|
try {
|
|
154
|
-
await installSkill(skillId, selectedAgentIds, installPath);
|
|
159
|
+
await installSkill(skillId, selectedAgentIds, installPath, installScope);
|
|
155
160
|
} catch (error) {
|
|
156
161
|
console.error(chalk.red(`\n Failed to install ${skillId}:`), error.message);
|
|
157
162
|
}
|
|
@@ -162,14 +167,17 @@ async function installWizard(preselectedSkill, preselectedAgents, customPath) {
|
|
|
162
167
|
|
|
163
168
|
async function handleInstall(args) {
|
|
164
169
|
const pathIdx = args.indexOf('--path');
|
|
170
|
+
const globalFlag = args.includes('--global');
|
|
165
171
|
let customPath = '';
|
|
166
|
-
let positional = [...args];
|
|
172
|
+
let positional = [...args].filter(a => a !== '--global');
|
|
167
173
|
|
|
168
174
|
if (pathIdx !== -1) {
|
|
169
|
-
customPath =
|
|
170
|
-
positional.
|
|
175
|
+
customPath = positional[positional.indexOf('--path') + 1] || '';
|
|
176
|
+
const pIdx = positional.indexOf('--path');
|
|
177
|
+
positional.splice(pIdx, 2);
|
|
171
178
|
}
|
|
172
179
|
|
|
180
|
+
const scope = globalFlag ? 'global' : 'project';
|
|
173
181
|
const skillId = positional[0];
|
|
174
182
|
const agentIds = positional.slice(1);
|
|
175
183
|
|
|
@@ -185,9 +193,9 @@ async function handleInstall(args) {
|
|
|
185
193
|
return;
|
|
186
194
|
}
|
|
187
195
|
|
|
188
|
-
// Full args → direct install
|
|
196
|
+
// Full args → direct install (defaults to project-level)
|
|
189
197
|
try {
|
|
190
|
-
await installSkill(skillId, agentIds, customPath);
|
|
198
|
+
await installSkill(skillId, agentIds, customPath, scope);
|
|
191
199
|
console.log(chalk.bold.green('\n Installation complete!\n'));
|
|
192
200
|
} catch (error) {
|
|
193
201
|
console.error(chalk.red('\n Installation failed:'), error.message);
|
package/lib/agents.js
CHANGED
|
@@ -7,7 +7,8 @@ const path = require('path');
|
|
|
7
7
|
* - id: unique identifier
|
|
8
8
|
* - name: display name
|
|
9
9
|
* - description: brief description
|
|
10
|
-
* -
|
|
10
|
+
* - getProjectPath: function that returns the project-level skills directory (relative to cwd)
|
|
11
|
+
* - getGlobalPath: function that returns the global/user-level skills directory
|
|
11
12
|
* - fileExtension: the file extension for skill files
|
|
12
13
|
* - template: the template type to use for this agent
|
|
13
14
|
*/
|
|
@@ -17,7 +18,8 @@ const agents = [
|
|
|
17
18
|
id: 'claude-code',
|
|
18
19
|
name: 'Claude Code',
|
|
19
20
|
description: 'Anthropic Claude Code CLI',
|
|
20
|
-
|
|
21
|
+
getProjectPath: () => path.join(process.cwd(), '.claude', 'skills'),
|
|
22
|
+
getGlobalPath: () => {
|
|
21
23
|
const platform = os.platform();
|
|
22
24
|
if (platform === 'win32') {
|
|
23
25
|
return path.join(os.homedir(), 'AppData', 'Roaming', 'Claude', 'skills');
|
|
@@ -34,7 +36,8 @@ const agents = [
|
|
|
34
36
|
id: 'gemini',
|
|
35
37
|
name: 'Google Gemini',
|
|
36
38
|
description: 'Google Gemini Code Assist',
|
|
37
|
-
|
|
39
|
+
getProjectPath: () => path.join(process.cwd(), '.gemini', 'skills'),
|
|
40
|
+
getGlobalPath: () => {
|
|
38
41
|
const platform = os.platform();
|
|
39
42
|
if (platform === 'win32') {
|
|
40
43
|
return path.join(os.homedir(), 'AppData', 'Roaming', 'Gemini', 'skills');
|
|
@@ -51,7 +54,8 @@ const agents = [
|
|
|
51
54
|
id: 'copilot',
|
|
52
55
|
name: 'GitHub Copilot',
|
|
53
56
|
description: 'GitHub Copilot Agent Mode',
|
|
54
|
-
|
|
57
|
+
getProjectPath: () => path.join(process.cwd(), '.github', 'copilot', 'skills'),
|
|
58
|
+
getGlobalPath: () => {
|
|
55
59
|
const platform = os.platform();
|
|
56
60
|
if (platform === 'win32') {
|
|
57
61
|
return path.join(os.homedir(), 'AppData', 'Roaming', 'GitHub Copilot', 'skills');
|
|
@@ -68,7 +72,8 @@ const agents = [
|
|
|
68
72
|
id: 'kilocode',
|
|
69
73
|
name: 'Kilocode',
|
|
70
74
|
description: 'Kilocode AI Assistant',
|
|
71
|
-
|
|
75
|
+
getProjectPath: () => path.join(process.cwd(), '.kilocode', 'skills'),
|
|
76
|
+
getGlobalPath: () => {
|
|
72
77
|
const platform = os.platform();
|
|
73
78
|
if (platform === 'win32') {
|
|
74
79
|
return path.join(os.homedir(), 'AppData', 'Roaming', 'Kilocode', 'skills');
|
|
@@ -85,7 +90,8 @@ const agents = [
|
|
|
85
90
|
id: 'cline',
|
|
86
91
|
name: 'Cline',
|
|
87
92
|
description: 'Cline AI Assistant',
|
|
88
|
-
|
|
93
|
+
getProjectPath: () => path.join(process.cwd(), '.cline', 'skills'),
|
|
94
|
+
getGlobalPath: () => {
|
|
89
95
|
const platform = os.platform();
|
|
90
96
|
if (platform === 'win32') {
|
|
91
97
|
return path.join(os.homedir(), 'AppData', 'Roaming', 'Code', 'User', 'globalStorage', 'saoudrizwan.claude-dev', 'skills');
|
|
@@ -102,7 +108,8 @@ const agents = [
|
|
|
102
108
|
id: 'cursor',
|
|
103
109
|
name: 'Cursor',
|
|
104
110
|
description: 'Cursor AI Editor',
|
|
105
|
-
|
|
111
|
+
getProjectPath: () => path.join(process.cwd(), '.cursor', 'skills'),
|
|
112
|
+
getGlobalPath: () => {
|
|
106
113
|
const platform = os.platform();
|
|
107
114
|
if (platform === 'win32') {
|
|
108
115
|
return path.join(os.homedir(), 'AppData', 'Roaming', 'Cursor', 'User', 'skills');
|
package/lib/installer.js
CHANGED
|
@@ -42,7 +42,7 @@ function listAgents() {
|
|
|
42
42
|
/**
|
|
43
43
|
* Install a skill for specified agents
|
|
44
44
|
*/
|
|
45
|
-
async function installSkill(skillId, agentIds, customPath = '') {
|
|
45
|
+
async function installSkill(skillId, agentIds, customPath = '', scope = 'project') {
|
|
46
46
|
const skills = listSkills();
|
|
47
47
|
const skill = skills.find(s => s.id === skillId);
|
|
48
48
|
|
|
@@ -64,7 +64,7 @@ async function installSkill(skillId, agentIds, customPath = '') {
|
|
|
64
64
|
|
|
65
65
|
try {
|
|
66
66
|
// Determine installation path
|
|
67
|
-
const installPath = customPath || agent.
|
|
67
|
+
const installPath = customPath || (scope === 'global' ? agent.getGlobalPath() : agent.getProjectPath());
|
|
68
68
|
|
|
69
69
|
// Ensure the skills directory exists
|
|
70
70
|
await fs.ensureDir(installPath);
|