angular-agents-skills 1.0.1 → 1.1.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/README.md +13 -13
- package/dist/src/cli.js +44 -32
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -92,47 +92,47 @@ npm install angular-agents-skills
|
|
|
92
92
|
|
|
93
93
|
```bash
|
|
94
94
|
# OpenCode
|
|
95
|
-
npx angular-
|
|
95
|
+
npx angular-agents-skills agent angular-architect --ai opencode
|
|
96
96
|
|
|
97
97
|
# Claude Code
|
|
98
|
-
npx angular-
|
|
98
|
+
npx angular-agents-skills agent angular-architect --ai claude
|
|
99
99
|
|
|
100
100
|
# Codex
|
|
101
|
-
npx angular-
|
|
101
|
+
npx angular-agents-skills agent angular-architect --ai codex
|
|
102
102
|
|
|
103
103
|
# Cursor
|
|
104
|
-
npx angular-
|
|
104
|
+
npx angular-agents-skills agent angular-architect --ai cursor
|
|
105
105
|
|
|
106
106
|
# Copilot
|
|
107
|
-
npx angular-
|
|
107
|
+
npx angular-agents-skills agent angular-architect --ai copilot
|
|
108
108
|
```
|
|
109
109
|
|
|
110
110
|
### Instalar un agent para todas las herramientas
|
|
111
111
|
|
|
112
112
|
```bash
|
|
113
|
-
npx angular-
|
|
113
|
+
npx angular-agents-skills agent angular-architect --all
|
|
114
114
|
```
|
|
115
115
|
|
|
116
116
|
### Instalar una skill
|
|
117
117
|
|
|
118
118
|
```bash
|
|
119
|
-
npx angular-
|
|
120
|
-
npx angular-
|
|
119
|
+
npx angular-agents-skills skill signals-state-management --ai opencode
|
|
120
|
+
npx angular-agents-skills skill defer-blocks --all
|
|
121
121
|
```
|
|
122
122
|
|
|
123
123
|
### Directorio personalizado
|
|
124
124
|
|
|
125
125
|
```bash
|
|
126
|
-
npx angular-
|
|
127
|
-
npx angular-
|
|
126
|
+
npx angular-agents-skills agent angular-architect --ai opencode --target ./my-agents
|
|
127
|
+
npx angular-agents-skills skill signals-effects --ai claude --target ./my-skills
|
|
128
128
|
```
|
|
129
129
|
|
|
130
130
|
### Listar recursos disponibles
|
|
131
131
|
|
|
132
132
|
```bash
|
|
133
|
-
npx angular-
|
|
134
|
-
npx angular-
|
|
135
|
-
npx angular-
|
|
133
|
+
npx angular-agents-skills list agents
|
|
134
|
+
npx angular-agents-skills list skills
|
|
135
|
+
npx angular-agents-skills list adapters
|
|
136
136
|
```
|
|
137
137
|
|
|
138
138
|
---
|
package/dist/src/cli.js
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { dirname, join, resolve } from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
3
5
|
import { parse as parseYaml } from 'yaml';
|
|
4
|
-
import { registerAdapter, getAdapter, listAdapters, hasAdapter } from './registry.js';
|
|
5
|
-
import { createOpenCodeAdapter } from '../adapters/opencode/index.js';
|
|
6
6
|
import { createClaudeAdapter } from '../adapters/claude/index.js';
|
|
7
7
|
import { createCodexAdapter } from '../adapters/codex/index.js';
|
|
8
|
-
import { createCursorAdapter } from '../adapters/cursor/index.js';
|
|
9
8
|
import { createCopilotAdapter } from '../adapters/copilot/index.js';
|
|
9
|
+
import { createCursorAdapter } from '../adapters/cursor/index.js';
|
|
10
|
+
import { createOpenCodeAdapter } from '../adapters/opencode/index.js';
|
|
11
|
+
import { getAdapter, hasAdapter, listAdapters, registerAdapter } from './registry.js';
|
|
12
|
+
// Determinar la raíz del paquete npm (subiendo dos niveles desde dist/src/cli.js)
|
|
13
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
14
|
+
const __dirname = dirname(__filename);
|
|
15
|
+
const PACKAGE_ROOT = resolve(__dirname, '..', '..');
|
|
10
16
|
registerAdapter(createOpenCodeAdapter());
|
|
11
17
|
registerAdapter(createClaudeAdapter());
|
|
12
18
|
registerAdapter(createCodexAdapter());
|
|
@@ -108,7 +114,11 @@ function installAgent(agentName, ai, agentsDir, targetDir) {
|
|
|
108
114
|
const agent = loadAgent(agentName, agentsDir);
|
|
109
115
|
const config = loadAgentConfig(agentName, ai, agentsDir);
|
|
110
116
|
const output = adapter.generate(agent, config);
|
|
111
|
-
|
|
117
|
+
// Asegurar que la ruta base apunte al directorio donde el usuario ejecuta el comando (process.cwd())
|
|
118
|
+
const resolvedTargetDir = targetDir
|
|
119
|
+
? resolve(process.cwd(), targetDir)
|
|
120
|
+
: resolve(process.cwd(), adapter.defaultDir);
|
|
121
|
+
const installPath = adapter.getInstallPath(agentName, resolvedTargetDir);
|
|
112
122
|
const dir = dirname(installPath);
|
|
113
123
|
mkdirSync(dir, { recursive: true });
|
|
114
124
|
writeFileSync(installPath, output.content, 'utf-8');
|
|
@@ -130,7 +140,10 @@ function installSkill(skillName, ai, skillsDir, targetDir) {
|
|
|
130
140
|
}
|
|
131
141
|
const skill = loadSkill(skillName, skillsDir);
|
|
132
142
|
const filename = `${skillName}.md`;
|
|
133
|
-
|
|
143
|
+
// Asegurar que la ruta base apunte al directorio donde el usuario ejecuta el comando (process.cwd())
|
|
144
|
+
const base = targetDir
|
|
145
|
+
? resolve(process.cwd(), targetDir)
|
|
146
|
+
: resolve(process.cwd(), adapter.defaultDir, 'skills');
|
|
134
147
|
const installPath = join(base, filename);
|
|
135
148
|
const dir = dirname(installPath);
|
|
136
149
|
mkdirSync(dir, { recursive: true });
|
|
@@ -147,28 +160,28 @@ function installSkillAll(skillName, skillsDir, targetDir) {
|
|
|
147
160
|
}
|
|
148
161
|
function printHelp() {
|
|
149
162
|
console.log(`
|
|
150
|
-
angular-
|
|
163
|
+
angular-agents-skills — Install Angular agents and skills for AI coding tools
|
|
151
164
|
|
|
152
|
-
Usage:
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
165
|
+
Usage:
|
|
166
|
+
npx angular-agents-skills agent <name> --ai <tool> [--target <path>]
|
|
167
|
+
npx angular-agents-skills agent <name> --all [--target <path>]
|
|
168
|
+
npx angular-agents-skills skill <name> --ai <tool> [--target <path>]
|
|
169
|
+
npx angular-agents-skills skill <name> --all [--target <path>]
|
|
170
|
+
npx angular-agents-skills list agents
|
|
171
|
+
npx angular-agents-skills list skills
|
|
172
|
+
npx angular-agents-skills list adapters
|
|
160
173
|
|
|
161
|
-
Options:
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
174
|
+
Options:
|
|
175
|
+
--ai <tool> Target AI tool: ${listAdapters().join(', ')}
|
|
176
|
+
--all Install for all available AI tools
|
|
177
|
+
--target <path> Custom target directory
|
|
165
178
|
|
|
166
|
-
Examples:
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
`);
|
|
179
|
+
Examples:
|
|
180
|
+
npx angular-agents-skills agent angular-architect --ai opencode
|
|
181
|
+
npx angular-agents-skills skill standalone-component-library --ai claude
|
|
182
|
+
npx angular-agents-skills agent angular-architect --ai opencode --target ./my-agents
|
|
183
|
+
npx angular-agents-skills skill signals-state-management --all
|
|
184
|
+
`);
|
|
172
185
|
}
|
|
173
186
|
function main() {
|
|
174
187
|
const args = process.argv.slice(2);
|
|
@@ -177,10 +190,12 @@ function main() {
|
|
|
177
190
|
return;
|
|
178
191
|
}
|
|
179
192
|
const command = args[0];
|
|
193
|
+
const agentsDir = join(PACKAGE_ROOT, 'agents');
|
|
194
|
+
const skillsDir = join(PACKAGE_ROOT, 'skills');
|
|
180
195
|
if (command === 'list') {
|
|
181
196
|
const type = args[1];
|
|
182
197
|
if (type === 'agents') {
|
|
183
|
-
const agents = listAgents(
|
|
198
|
+
const agents = listAgents(agentsDir);
|
|
184
199
|
if (agents.length === 0) {
|
|
185
200
|
console.log('No agents found.');
|
|
186
201
|
}
|
|
@@ -193,7 +208,7 @@ function main() {
|
|
|
193
208
|
return;
|
|
194
209
|
}
|
|
195
210
|
if (type === 'skills') {
|
|
196
|
-
const skills = listSkills(
|
|
211
|
+
const skills = listSkills(skillsDir);
|
|
197
212
|
if (skills.length === 0) {
|
|
198
213
|
console.log('No skills found.');
|
|
199
214
|
}
|
|
@@ -226,7 +241,6 @@ function main() {
|
|
|
226
241
|
const allFlag = args.includes('--all');
|
|
227
242
|
const targetIndex = args.indexOf('--target');
|
|
228
243
|
const targetDir = targetIndex !== -1 ? args[targetIndex + 1] : undefined;
|
|
229
|
-
const agentsDir = resolve('agents');
|
|
230
244
|
if (!allFlag && aiIndex === -1) {
|
|
231
245
|
console.error('Error: specify --ai <tool> or --all');
|
|
232
246
|
process.exit(1);
|
|
@@ -260,7 +274,6 @@ function main() {
|
|
|
260
274
|
const allFlag = args.includes('--all');
|
|
261
275
|
const targetIndex = args.indexOf('--target');
|
|
262
276
|
const targetDir = targetIndex !== -1 ? args[targetIndex + 1] : undefined;
|
|
263
|
-
const skillsDir = resolve('skills');
|
|
264
277
|
if (!allFlag && aiIndex === -1) {
|
|
265
278
|
console.error('Error: specify --ai <tool> or --all');
|
|
266
279
|
process.exit(1);
|
|
@@ -289,5 +302,4 @@ function main() {
|
|
|
289
302
|
process.exit(1);
|
|
290
303
|
}
|
|
291
304
|
main();
|
|
292
|
-
export {
|
|
293
|
-
export { registerAdapter, getAdapter, listAdapters, hasAdapter };
|
|
305
|
+
export { getAdapter, hasAdapter, installAgent, installAgentAll, installSkill, installSkillAll, listAdapters, listAgents, listSkills, loadAgent, loadAgentConfig, loadSkill, registerAdapter };
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "angular-agents-skills",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Install Angular agents and skills for AI coding tools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
-
"angular-
|
|
7
|
+
"angular-agents-skills": "dist/src/cli.js"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"build": "tsc",
|