agentic-team-templates 0.6.1 → 0.7.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 +73 -39
- package/package.json +1 -1
- package/src/index.js +63 -0
- package/src/index.test.js +54 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# agentic-team-templates
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/agentic-team-templates)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
|
|
6
6
|
**Compatible with:**
|
|
@@ -23,14 +23,14 @@ AI coding assistant templates for Cursor IDE, Claude Code, and GitHub Copilot. P
|
|
|
23
23
|
No installation required. Run directly with `npx`:
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
-
npx
|
|
26
|
+
npx agentic-team-templates <template-name>
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
Or install globally:
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
|
-
npm install -g
|
|
33
|
-
|
|
32
|
+
npm install -g agentic-team-templates
|
|
33
|
+
agentic-team-templates <template-name>
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
## How to Use
|
|
@@ -40,7 +40,7 @@ cursor-templates <template-name>
|
|
|
40
40
|
Navigate to your project directory and run:
|
|
41
41
|
|
|
42
42
|
```bash
|
|
43
|
-
npx
|
|
43
|
+
npx agentic-team-templates web-frontend
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
This installs the template rules in your project directory.
|
|
@@ -50,13 +50,13 @@ This installs the template rules in your project directory.
|
|
|
50
50
|
Combine templates for projects that span multiple domains:
|
|
51
51
|
|
|
52
52
|
```bash
|
|
53
|
-
npx
|
|
53
|
+
npx agentic-team-templates web-frontend web-backend
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
### List All Available Templates
|
|
57
57
|
|
|
58
58
|
```bash
|
|
59
|
-
npx
|
|
59
|
+
npx agentic-team-templates --list
|
|
60
60
|
```
|
|
61
61
|
|
|
62
62
|
### Preview Before Installing (Dry Run)
|
|
@@ -64,7 +64,7 @@ npx cursor-templates --list
|
|
|
64
64
|
See what files will be created without making changes:
|
|
65
65
|
|
|
66
66
|
```bash
|
|
67
|
-
npx
|
|
67
|
+
npx agentic-team-templates web-frontend --dry-run
|
|
68
68
|
```
|
|
69
69
|
|
|
70
70
|
### Update to Latest Rules
|
|
@@ -72,7 +72,7 @@ npx cursor-templates web-frontend --dry-run
|
|
|
72
72
|
Re-run with `@latest` to get updated templates:
|
|
73
73
|
|
|
74
74
|
```bash
|
|
75
|
-
npx
|
|
75
|
+
npx agentic-team-templates@latest web-frontend
|
|
76
76
|
```
|
|
77
77
|
|
|
78
78
|
### Install for Specific IDE
|
|
@@ -81,16 +81,16 @@ By default, templates install for all supported IDEs (Cursor, Claude, Copilot).
|
|
|
81
81
|
|
|
82
82
|
```bash
|
|
83
83
|
# Install only for Cursor IDE
|
|
84
|
-
npx
|
|
84
|
+
npx agentic-team-templates web-frontend --ide=cursor
|
|
85
85
|
|
|
86
86
|
# Install only for Claude Code
|
|
87
|
-
npx
|
|
87
|
+
npx agentic-team-templates web-frontend --ide=claude
|
|
88
88
|
|
|
89
89
|
# Install only for GitHub Copilot
|
|
90
|
-
npx
|
|
90
|
+
npx agentic-team-templates web-frontend --ide=codex
|
|
91
91
|
|
|
92
92
|
# Install for multiple IDEs
|
|
93
|
-
npx
|
|
93
|
+
npx agentic-team-templates web-frontend --ide=cursor --ide=codex
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
### Remove Specific Templates
|
|
@@ -99,16 +99,16 @@ Remove templates you no longer need while keeping shared rules and other templat
|
|
|
99
99
|
|
|
100
100
|
```bash
|
|
101
101
|
# Remove a single template
|
|
102
|
-
npx
|
|
102
|
+
npx agentic-team-templates --remove web-frontend
|
|
103
103
|
|
|
104
104
|
# Remove multiple templates
|
|
105
|
-
npx
|
|
105
|
+
npx agentic-team-templates --remove web-frontend web-backend
|
|
106
106
|
|
|
107
107
|
# Remove from specific IDE only
|
|
108
|
-
npx
|
|
108
|
+
npx agentic-team-templates --remove web-frontend --ide=cursor
|
|
109
109
|
|
|
110
110
|
# Skip confirmation prompt
|
|
111
|
-
npx
|
|
111
|
+
npx agentic-team-templates --remove web-frontend --yes
|
|
112
112
|
```
|
|
113
113
|
|
|
114
114
|
### Reset (Remove Everything)
|
|
@@ -117,16 +117,16 @@ Remove all installed content (shared rules, templates, generated files):
|
|
|
117
117
|
|
|
118
118
|
```bash
|
|
119
119
|
# Reset all installed content
|
|
120
|
-
npx
|
|
120
|
+
npx agentic-team-templates --reset
|
|
121
121
|
|
|
122
122
|
# Reset for specific IDE only
|
|
123
|
-
npx
|
|
123
|
+
npx agentic-team-templates --reset --ide=cursor
|
|
124
124
|
|
|
125
125
|
# Skip confirmation prompt
|
|
126
|
-
npx
|
|
126
|
+
npx agentic-team-templates --reset --yes
|
|
127
127
|
|
|
128
128
|
# Force remove modified files
|
|
129
|
-
npx
|
|
129
|
+
npx agentic-team-templates --reset --force
|
|
130
130
|
```
|
|
131
131
|
|
|
132
132
|
### CLI Options
|
|
@@ -186,27 +186,26 @@ Each template adds domain-specific rules. For example, `web-frontend` includes:
|
|
|
186
186
|
|
|
187
187
|
## File Structure
|
|
188
188
|
|
|
189
|
-
After running `npx
|
|
189
|
+
After running `npx agentic-team-templates web-frontend`:
|
|
190
190
|
|
|
191
191
|
```
|
|
192
192
|
your-project/
|
|
193
193
|
├── CLAUDE.md # Development guide (Claude Code, Cursor)
|
|
194
194
|
├── .cursorrules/ # Rule files (Cursor IDE)
|
|
195
|
-
│
|
|
195
|
+
│ ├── core-principles.md # Shared
|
|
196
|
+
│ ├── code-quality.md # Shared
|
|
197
|
+
│ ├── security-fundamentals.md # Shared
|
|
198
|
+
│ ├── git-workflow.md # Shared
|
|
199
|
+
│ ├── communication.md # Shared
|
|
200
|
+
│ ├── web-frontend-overview.md # Template-specific
|
|
201
|
+
│ ├── web-frontend-accessibility.md # Template-specific
|
|
202
|
+
│ ├── web-frontend-component-patterns.md # Template-specific
|
|
203
|
+
│ ├── web-frontend-performance.md # Template-specific
|
|
204
|
+
│ ├── web-frontend-state-management.md # Template-specific
|
|
205
|
+
│ ├── web-frontend-styling.md # Template-specific
|
|
206
|
+
│ └── web-frontend-testing.md # Template-specific
|
|
196
207
|
└── .github/
|
|
197
208
|
└── copilot-instructions.md # Instructions (GitHub Copilot)
|
|
198
|
-
├── core-principles.md # Shared
|
|
199
|
-
├── code-quality.md # Shared
|
|
200
|
-
├── security-fundamentals.md # Shared
|
|
201
|
-
├── git-workflow.md # Shared
|
|
202
|
-
├── communication.md # Shared
|
|
203
|
-
├── web-frontend-overview.md # Template-specific
|
|
204
|
-
├── web-frontend-accessibility.md # Template-specific
|
|
205
|
-
├── web-frontend-component-patterns.md # Template-specific
|
|
206
|
-
├── web-frontend-performance.md # Template-specific
|
|
207
|
-
├── web-frontend-state-management.md # Template-specific
|
|
208
|
-
├── web-frontend-styling.md # Template-specific
|
|
209
|
-
└── web-frontend-testing.md # Template-specific
|
|
210
209
|
```
|
|
211
210
|
|
|
212
211
|
## Customization
|
|
@@ -238,7 +237,7 @@ Templates merge with your existing `.cursorrules/` directory. Existing files are
|
|
|
238
237
|
```bash
|
|
239
238
|
mkdir my-react-app && cd my-react-app
|
|
240
239
|
npm create vite@latest . -- --template react-ts
|
|
241
|
-
npx
|
|
240
|
+
npx agentic-team-templates web-frontend
|
|
242
241
|
```
|
|
243
242
|
|
|
244
243
|
### Full-Stack Next.js Project
|
|
@@ -246,21 +245,21 @@ npx cursor-templates web-frontend
|
|
|
246
245
|
```bash
|
|
247
246
|
npx create-next-app@latest my-app
|
|
248
247
|
cd my-app
|
|
249
|
-
npx
|
|
248
|
+
npx agentic-team-templates fullstack
|
|
250
249
|
```
|
|
251
250
|
|
|
252
251
|
### Microservices Backend
|
|
253
252
|
|
|
254
253
|
```bash
|
|
255
254
|
cd my-api-service
|
|
256
|
-
npx
|
|
255
|
+
npx agentic-team-templates web-backend devops-sre
|
|
257
256
|
```
|
|
258
257
|
|
|
259
258
|
### ML/AI Project
|
|
260
259
|
|
|
261
260
|
```bash
|
|
262
261
|
cd my-ml-project
|
|
263
|
-
npx
|
|
262
|
+
npx agentic-team-templates ml-ai data-engineering
|
|
264
263
|
```
|
|
265
264
|
|
|
266
265
|
## Requirements
|
|
@@ -271,6 +270,41 @@ npx cursor-templates ml-ai data-engineering
|
|
|
271
270
|
- Claude Code (reads `CLAUDE.md` automatically)
|
|
272
271
|
- GitHub Copilot (reads `.github/copilot-instructions.md`)
|
|
273
272
|
|
|
273
|
+
## Troubleshooting
|
|
274
|
+
|
|
275
|
+
### "Unknown option" or Missing Features
|
|
276
|
+
|
|
277
|
+
If you're getting errors for options that should exist (like `--reset`), you may have a cached old version:
|
|
278
|
+
|
|
279
|
+
```bash
|
|
280
|
+
# Force latest version (recommended)
|
|
281
|
+
npx agentic-team-templates@latest <command>
|
|
282
|
+
|
|
283
|
+
# Clear npx cache
|
|
284
|
+
npx clear-npx-cache
|
|
285
|
+
|
|
286
|
+
# Or manually clear npm cache
|
|
287
|
+
npm cache clean --force
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
### Verify Your Version
|
|
291
|
+
|
|
292
|
+
Check which version you're running:
|
|
293
|
+
|
|
294
|
+
```bash
|
|
295
|
+
npx agentic-team-templates@latest --help
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
The CLI will notify you if a newer version is available.
|
|
299
|
+
|
|
300
|
+
### Update Global Installation
|
|
301
|
+
|
|
302
|
+
If installed globally:
|
|
303
|
+
|
|
304
|
+
```bash
|
|
305
|
+
npm update -g agentic-team-templates
|
|
306
|
+
```
|
|
307
|
+
|
|
274
308
|
## How to Contribute
|
|
275
309
|
|
|
276
310
|
We welcome contributions! Here's how to add new templates or improve existing ones.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentic-team-templates",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "AI coding assistant templates for Cursor IDE. Pre-configured rules and guidelines that help AI assistants write better code. - use at your own risk",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cursor",
|
package/src/index.js
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import { fileURLToPath } from 'url';
|
|
4
|
+
import { exec } from 'child_process';
|
|
5
|
+
import { promisify } from 'util';
|
|
6
|
+
|
|
7
|
+
const execAsync = promisify(exec);
|
|
4
8
|
|
|
5
9
|
const __filename = fileURLToPath(import.meta.url);
|
|
6
10
|
const __dirname = path.dirname(__filename);
|
|
7
11
|
const TEMPLATES_DIR = path.join(__dirname, '..', 'templates');
|
|
8
12
|
|
|
13
|
+
// Read package.json for version info
|
|
14
|
+
const packageJsonPath = path.join(__dirname, '..', 'package.json');
|
|
15
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
|
16
|
+
const PACKAGE_NAME = packageJson.name;
|
|
17
|
+
const CURRENT_VERSION = packageJson.version;
|
|
18
|
+
|
|
9
19
|
// Available templates
|
|
10
20
|
const TEMPLATES = {
|
|
11
21
|
'blockchain': {
|
|
@@ -61,8 +71,50 @@ const colors = {
|
|
|
61
71
|
yellow: (s) => `\x1b[33m${s}\x1b[0m`,
|
|
62
72
|
blue: (s) => `\x1b[34m${s}\x1b[0m`,
|
|
63
73
|
dim: (s) => `\x1b[2m${s}\x1b[0m`,
|
|
74
|
+
cyan: (s) => `\x1b[36m${s}\x1b[0m`,
|
|
64
75
|
};
|
|
65
76
|
|
|
77
|
+
/**
|
|
78
|
+
* Compare two semver version strings
|
|
79
|
+
* @returns {number} -1 if a < b, 0 if a === b, 1 if a > b
|
|
80
|
+
*/
|
|
81
|
+
function compareVersions(a, b) {
|
|
82
|
+
const partsA = a.split('.').map(Number);
|
|
83
|
+
const partsB = b.split('.').map(Number);
|
|
84
|
+
|
|
85
|
+
for (let i = 0; i < 3; i++) {
|
|
86
|
+
const numA = partsA[i] || 0;
|
|
87
|
+
const numB = partsB[i] || 0;
|
|
88
|
+
if (numA < numB) return -1;
|
|
89
|
+
if (numA > numB) return 1;
|
|
90
|
+
}
|
|
91
|
+
return 0;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Check npm for the latest version and notify if update available
|
|
96
|
+
* Fails silently on network errors
|
|
97
|
+
*/
|
|
98
|
+
async function checkForUpdates() {
|
|
99
|
+
try {
|
|
100
|
+
const { stdout } = await execAsync(`npm view ${PACKAGE_NAME} version`, {
|
|
101
|
+
timeout: 5000, // 5 second timeout
|
|
102
|
+
});
|
|
103
|
+
const latestVersion = stdout.trim();
|
|
104
|
+
|
|
105
|
+
if (compareVersions(CURRENT_VERSION, latestVersion) < 0) {
|
|
106
|
+
console.log(colors.cyan(`
|
|
107
|
+
┌────────────────────────────────────────────────────────────┐
|
|
108
|
+
│ Update available: ${CURRENT_VERSION} → ${latestVersion} │
|
|
109
|
+
│ Run: npx ${PACKAGE_NAME}@latest │
|
|
110
|
+
└────────────────────────────────────────────────────────────┘
|
|
111
|
+
`));
|
|
112
|
+
}
|
|
113
|
+
} catch {
|
|
114
|
+
// Silently ignore network errors or timeouts
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
66
118
|
function printBanner() {
|
|
67
119
|
console.log(colors.blue(`
|
|
68
120
|
╔═══════════════════════════════════════════════════════════╗
|
|
@@ -83,6 +135,7 @@ ${colors.yellow('Options:')}
|
|
|
83
135
|
Default: all (cursor, claude, codex)
|
|
84
136
|
--list, -l List available templates
|
|
85
137
|
--help, -h Show this help message
|
|
138
|
+
--version, -v Show version number
|
|
86
139
|
--dry-run Show what would be changed
|
|
87
140
|
--force, -f Overwrite/remove even if files were modified
|
|
88
141
|
--yes, -y Skip confirmation prompt (for --remove and --reset)
|
|
@@ -1225,6 +1278,9 @@ export async function run(args) {
|
|
|
1225
1278
|
printBanner();
|
|
1226
1279
|
printHelp();
|
|
1227
1280
|
process.exit(0);
|
|
1281
|
+
} else if (arg === '--version' || arg === '-v') {
|
|
1282
|
+
console.log(`${PACKAGE_NAME} v${CURRENT_VERSION}`);
|
|
1283
|
+
process.exit(0);
|
|
1228
1284
|
} else if (arg === '--dry-run') {
|
|
1229
1285
|
dryRun = true;
|
|
1230
1286
|
} else if (arg === '--force' || arg === '-f') {
|
|
@@ -1255,6 +1311,9 @@ export async function run(args) {
|
|
|
1255
1311
|
}
|
|
1256
1312
|
|
|
1257
1313
|
printBanner();
|
|
1314
|
+
|
|
1315
|
+
// Check for updates (non-blocking, fails silently)
|
|
1316
|
+
await checkForUpdates();
|
|
1258
1317
|
|
|
1259
1318
|
// Use default IDEs if none specified
|
|
1260
1319
|
const targetIdes = ides.length > 0 ? ides : DEFAULT_IDES;
|
|
@@ -1339,10 +1398,14 @@ export async function run(args) {
|
|
|
1339
1398
|
|
|
1340
1399
|
// Export internals for testing
|
|
1341
1400
|
export const _internals = {
|
|
1401
|
+
PACKAGE_NAME,
|
|
1402
|
+
CURRENT_VERSION,
|
|
1342
1403
|
TEMPLATES,
|
|
1343
1404
|
SHARED_RULES,
|
|
1344
1405
|
SUPPORTED_IDES,
|
|
1345
1406
|
DEFAULT_IDES,
|
|
1407
|
+
compareVersions,
|
|
1408
|
+
checkForUpdates,
|
|
1346
1409
|
filesMatch,
|
|
1347
1410
|
parseMarkdownSections,
|
|
1348
1411
|
generateSectionSignature,
|
package/src/index.test.js
CHANGED
|
@@ -5,10 +5,13 @@ import os from 'os';
|
|
|
5
5
|
import { run, _internals } from './index.js';
|
|
6
6
|
|
|
7
7
|
const {
|
|
8
|
+
PACKAGE_NAME,
|
|
9
|
+
CURRENT_VERSION,
|
|
8
10
|
TEMPLATES,
|
|
9
11
|
SHARED_RULES,
|
|
10
12
|
SUPPORTED_IDES,
|
|
11
13
|
DEFAULT_IDES,
|
|
14
|
+
compareVersions,
|
|
12
15
|
filesMatch,
|
|
13
16
|
parseMarkdownSections,
|
|
14
17
|
generateSectionSignature,
|
|
@@ -28,6 +31,44 @@ const {
|
|
|
28
31
|
// Constants & Configuration Tests
|
|
29
32
|
// ============================================================================
|
|
30
33
|
|
|
34
|
+
describe('Package Info', () => {
|
|
35
|
+
it('should have a valid package name', () => {
|
|
36
|
+
expect(PACKAGE_NAME).toBe('agentic-team-templates');
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('should have a valid semver version', () => {
|
|
40
|
+
expect(CURRENT_VERSION).toMatch(/^\d+\.\d+\.\d+/);
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
describe('Version Comparison', () => {
|
|
45
|
+
describe('compareVersions', () => {
|
|
46
|
+
it('should return 0 for equal versions', () => {
|
|
47
|
+
expect(compareVersions('1.0.0', '1.0.0')).toBe(0);
|
|
48
|
+
expect(compareVersions('2.5.3', '2.5.3')).toBe(0);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('should return -1 when first version is lower', () => {
|
|
52
|
+
expect(compareVersions('1.0.0', '1.0.1')).toBe(-1);
|
|
53
|
+
expect(compareVersions('1.0.0', '1.1.0')).toBe(-1);
|
|
54
|
+
expect(compareVersions('1.0.0', '2.0.0')).toBe(-1);
|
|
55
|
+
expect(compareVersions('0.6.1', '0.7.0')).toBe(-1);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it('should return 1 when first version is higher', () => {
|
|
59
|
+
expect(compareVersions('1.0.1', '1.0.0')).toBe(1);
|
|
60
|
+
expect(compareVersions('1.1.0', '1.0.0')).toBe(1);
|
|
61
|
+
expect(compareVersions('2.0.0', '1.0.0')).toBe(1);
|
|
62
|
+
expect(compareVersions('0.7.0', '0.6.1')).toBe(1);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it('should handle missing patch versions', () => {
|
|
66
|
+
expect(compareVersions('1.0', '1.0.0')).toBe(0);
|
|
67
|
+
expect(compareVersions('1.0.0', '1.0')).toBe(0);
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
|
|
31
72
|
describe('Constants', () => {
|
|
32
73
|
describe('TEMPLATES', () => {
|
|
33
74
|
it('should have all expected templates', () => {
|
|
@@ -842,6 +883,19 @@ describe('CLI Argument Parsing', () => {
|
|
|
842
883
|
expect(exitSpy).toHaveBeenCalledWith(0);
|
|
843
884
|
});
|
|
844
885
|
|
|
886
|
+
it('should show version with --version', async () => {
|
|
887
|
+
await expect(run(['--version'])).rejects.toThrow('process.exit');
|
|
888
|
+
|
|
889
|
+
expect(exitSpy).toHaveBeenCalledWith(0);
|
|
890
|
+
expect(consoleLogSpy).toHaveBeenCalledWith(expect.stringContaining('agentic-team-templates'));
|
|
891
|
+
});
|
|
892
|
+
|
|
893
|
+
it('should show version with -v', async () => {
|
|
894
|
+
await expect(run(['-v'])).rejects.toThrow('process.exit');
|
|
895
|
+
|
|
896
|
+
expect(exitSpy).toHaveBeenCalledWith(0);
|
|
897
|
+
});
|
|
898
|
+
|
|
845
899
|
it('should error on unknown option', async () => {
|
|
846
900
|
await expect(run(['--unknown-option'])).rejects.toThrow('process.exit');
|
|
847
901
|
|