agents-templated 1.2.12 ā 2.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 +17 -21
- package/bin/cli.js +76 -59
- package/index.js +2 -10
- package/lib/instructions.js +124 -102
- package/package.json +1 -1
- package/templates/.cursorrules +9 -70
- package/templates/.github/copilot-instructions.md +7 -62
- package/templates/AGENTS.md +5 -0
- package/templates/CLAUDE.md +116 -47
- package/templates/README.md +17 -21
- package/templates/agent-docs/ARCHITECTURE.md +6 -5
- package/templates/agent-docs/README.md +6 -11
- package/templates/agents/rules/ai-integration.mdc +54 -0
- package/templates/agents/rules/guardrails.mdc +97 -0
- package/templates/agents/rules/intent-routing.mdc +9 -0
- package/templates/agents/rules/planning.mdc +69 -0
- package/templates/agents/skills/README.md +0 -7
- package/templates/agents/skills/api-design/SKILL.md +59 -0
- package/templates/agents/skills/llm-integration/SKILL.md +64 -0
- package/templates/instructions/source/core.md +209 -26
- package/templates/AGENTS.MD +0 -665
package/README.md
CHANGED
|
@@ -100,7 +100,7 @@ Your AI assistant will auto-load the configurations and follow enterprise patter
|
|
|
100
100
|
|---------|-------------|
|
|
101
101
|
| š **Quick Start Presets** | 5 popular tech stack presets (Next.js, Express, Django, FastAPI, Go) |
|
|
102
102
|
| š§ **Interactive Wizard** | Guided setup with personalized recommendations |
|
|
103
|
-
| š¤ **
|
|
103
|
+
| š¤ **AI Agents Supported** | Cursor, GitHub Copilot, Claude, and generic agents via `AGENTS.MD` |
|
|
104
104
|
| š§ **Deterministic Commands** | Slash-command contracts with strict structured outputs |
|
|
105
105
|
| š¬ **Auto Intent Routing** | Non-slash prompts can map to command contracts (`slash-command-auto`) |
|
|
106
106
|
| š **Security-First** | OWASP Top 10 protection patterns built-in |
|
|
@@ -115,14 +115,14 @@ Your AI assistant will auto-load the configurations and follow enterprise patter
|
|
|
115
115
|
|
|
116
116
|
## š¤ AI Agent Support
|
|
117
117
|
|
|
118
|
-
Agents Templated automatically configures
|
|
118
|
+
Agents Templated automatically configures compatible wrappers for major AI coding assistants:
|
|
119
119
|
|
|
120
120
|
| AI Agent | Config File | Auto-Discovery |
|
|
121
121
|
|----------|-------------|----------------|
|
|
122
122
|
| **Cursor** | `.cursorrules` | ā
Auto-loads in Cursor IDE |
|
|
123
|
-
| **GitHub Copilot** | `.github/
|
|
124
|
-
| **Claude** |
|
|
125
|
-
| **
|
|
123
|
+
| **GitHub Copilot** | `.github/copilot-instructions.md` | ā
Auto-loads in VS Code |
|
|
124
|
+
| **Claude** | `CLAUDE.md` | ā
Compatible |
|
|
125
|
+
| **Generic agents** | `AGENTS.MD` | ā
Compatible |
|
|
126
126
|
|
|
127
127
|
**Single source of truth:** `instructions/source/core.md` drives generated tool-compatible instruction files.
|
|
128
128
|
|
|
@@ -143,11 +143,8 @@ your-project/
|
|
|
143
143
|
ā āāā README.md # Human-readable setup guide
|
|
144
144
|
ā
|
|
145
145
|
āāā .github/
|
|
146
|
-
ā āāā instructions/ #
|
|
146
|
+
ā āāā instructions/ # Generated compatibility wrappers + rules
|
|
147
147
|
ā ā āāā AGENTS.md
|
|
148
|
-
ā ā āāā copilot-instructions.md
|
|
149
|
-
ā ā āāā CLAUDE.md
|
|
150
|
-
ā ā āāā GEMINI.md
|
|
151
148
|
ā ā āāā rules/
|
|
152
149
|
ā ā āāā core.mdc # Core development principles
|
|
153
150
|
ā ā āāā security.mdc # Security patterns (CRITICAL)
|
|
@@ -181,8 +178,7 @@ your-project/
|
|
|
181
178
|
ā
|
|
182
179
|
āāā AGENTS.MD # Compatibility shim for generic agents
|
|
183
180
|
āāā CLAUDE.md # Compatibility shim for Claude tooling
|
|
184
|
-
āāā
|
|
185
|
-
āāā .cursorrules # Cursor IDE config
|
|
181
|
+
āāā .cursorrules # Compatibility shim for Cursor
|
|
186
182
|
āāā .gitignore # Pre-configured Git ignore
|
|
187
183
|
āāā README.md # Project documentation
|
|
188
184
|
```
|
|
@@ -262,7 +258,7 @@ Open your AI assistant and it will automatically load the appropriate config:
|
|
|
262
258
|
- **Cursor**: Opens `.cursorrules` automatically
|
|
263
259
|
- **GitHub Copilot**: Reads `.github/copilot-instructions.md`
|
|
264
260
|
- **Claude**: Reads `CLAUDE.md`
|
|
265
|
-
- **
|
|
261
|
+
- **Generic/other tools**: Read `AGENTS.MD`
|
|
266
262
|
|
|
267
263
|
### 3. Create Custom Skills (Optional)
|
|
268
264
|
|
|
@@ -270,13 +266,13 @@ Extend your AI agents with domain-specific skills for your project:
|
|
|
270
266
|
|
|
271
267
|
```bash
|
|
272
268
|
# View the skills guide
|
|
273
|
-
cat
|
|
269
|
+
cat .github/skills/README.md
|
|
274
270
|
```
|
|
275
271
|
|
|
276
|
-
Create a new skill folder in
|
|
272
|
+
Create a new skill folder in `.github/skills/`:
|
|
277
273
|
|
|
278
274
|
```markdown
|
|
279
|
-
|
|
275
|
+
.github/skills/my-custom-skill/SKILL.md
|
|
280
276
|
---
|
|
281
277
|
name: my-custom-skill
|
|
282
278
|
description: Custom patterns for my project domain
|
|
@@ -296,15 +292,15 @@ Use this skill when working with [your domain].
|
|
|
296
292
|
Code and examples...
|
|
297
293
|
```
|
|
298
294
|
|
|
299
|
-
Skills define *how to execute specific tasks*, complementing rules that define *how to behave*. See [
|
|
295
|
+
Skills define *how to execute specific tasks*, complementing rules that define *how to behave*. See [.github/skills/README.md](.github/skills/README.md) for detailed guidance.
|
|
300
296
|
|
|
301
297
|
### 4. Read the Documentation
|
|
302
298
|
|
|
303
299
|
- **[AGENTS.MD](AGENTS.MD)** ā AI assistant guide
|
|
304
300
|
- **[agent-docs/ARCHITECTURE.md](agent-docs/ARCHITECTURE.md)** ā Project architecture & tech stack guidance
|
|
305
|
-
- **[
|
|
306
|
-
- **[
|
|
307
|
-
- **[
|
|
301
|
+
- **[.github/skills/README.md](.github/skills/README.md)** ā Custom skills guide
|
|
302
|
+
- **[.github/instructions/rules/security.mdc](.github/instructions/rules/security.mdc)** ā Security patterns (CRITICAL)
|
|
303
|
+
- **[.github/instructions/rules/testing.mdc](.github/instructions/rules/testing.mdc)** ā Testing strategy
|
|
308
304
|
|
|
309
305
|
### 5. Start Building
|
|
310
306
|
|
|
@@ -330,7 +326,7 @@ Your AI will follow the enterprise patterns automatically!
|
|
|
330
326
|
ā
Sanitize outputs to prevent injection attacks
|
|
331
327
|
ā
Never expose sensitive data in error messages or logs
|
|
332
328
|
|
|
333
|
-
**Reference**: [
|
|
329
|
+
**Reference**: [.github/instructions/rules/security.mdc](.github/instructions/rules/security.mdc)
|
|
334
330
|
|
|
335
331
|
### Testing Strategy
|
|
336
332
|
|
|
@@ -338,7 +334,7 @@ Your AI will follow the enterprise patterns automatically!
|
|
|
338
334
|
- **15% Integration Tests** ā API endpoints, database operations
|
|
339
335
|
- **5% E2E Tests** ā Critical user journeys
|
|
340
336
|
|
|
341
|
-
**Reference**: [
|
|
337
|
+
**Reference**: [.github/instructions/rules/testing.mdc](.github/instructions/rules/testing.mdc)
|
|
342
338
|
|
|
343
339
|
### Agent-Based Architecture
|
|
344
340
|
|
package/bin/cli.js
CHANGED
|
@@ -14,10 +14,12 @@ const {
|
|
|
14
14
|
getLegacyMigrationPlan
|
|
15
15
|
} = require('../lib/layout');
|
|
16
16
|
const {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
CANONICAL_INSTRUCTION_FILE,
|
|
18
|
+
POINTER_FILES,
|
|
19
19
|
writeGeneratedInstructions,
|
|
20
|
-
validateInstructionDrift
|
|
20
|
+
validateInstructionDrift,
|
|
21
|
+
scaffoldSkill,
|
|
22
|
+
scaffoldRule
|
|
21
23
|
} = require('../lib/instructions');
|
|
22
24
|
|
|
23
25
|
// Resolve the templates directory - works in both dev and installed contexts
|
|
@@ -152,7 +154,6 @@ program
|
|
|
152
154
|
const targetDocsDir = path.join(targetDir, 'agent-docs');
|
|
153
155
|
await fs.ensureDir(targetDocsDir);
|
|
154
156
|
await copyDirectory(sourceDir, targetDocsDir, options.force);
|
|
155
|
-
await copyFiles(templateDir, targetDir, [CORE_SOURCE_REL_PATH], options.force);
|
|
156
157
|
}
|
|
157
158
|
|
|
158
159
|
// Install agent rules
|
|
@@ -181,20 +182,18 @@ program
|
|
|
181
182
|
if (installAll || choices.includes('github')) {
|
|
182
183
|
console.log(chalk.yellow('Installing AI agent instructions...'));
|
|
183
184
|
await fs.ensureDir(path.join(targetDir, '.github', 'instructions'));
|
|
184
|
-
await copyFiles(templateDir, targetDir, ['.cursorrules'], options.force);
|
|
185
185
|
await writeGeneratedInstructions(targetDir, templateDir, options.force);
|
|
186
|
-
console.log(chalk.gray(' ā
|
|
187
|
-
console.log(chalk.gray(' ā GitHub Copilot (.github/copilot-instructions.md
|
|
188
|
-
console.log(chalk.gray(' ā
|
|
189
|
-
console.log(chalk.gray(' ā Generic AGENTS (AGENTS.MD shim + canonical .github/instructions/AGENTS.md)'));
|
|
186
|
+
console.log(chalk.gray(' ā Claude (CLAUDE.md ā canonical source)'));
|
|
187
|
+
console.log(chalk.gray(' ā GitHub Copilot (.github/copilot-instructions.md pointer)'));
|
|
188
|
+
console.log(chalk.gray(' ā Generic AGENTS (AGENTS.MD pointer)'));
|
|
190
189
|
}
|
|
191
190
|
|
|
192
191
|
console.log(chalk.green.bold('\nInstallation complete!\n'));
|
|
193
192
|
console.log(chalk.cyan('Next steps:'));
|
|
194
|
-
console.log(chalk.white(' 1. Review
|
|
193
|
+
console.log(chalk.white(' 1. Review CLAUDE.md (canonical AI policy ā edit this directly)'));
|
|
195
194
|
console.log(chalk.white(' 2. Review agent-docs/ARCHITECTURE.md for project guidelines'));
|
|
196
|
-
console.log(chalk.white(' 3.
|
|
197
|
-
console.log(chalk.white(' 4. Configure your AI assistant (
|
|
195
|
+
console.log(chalk.white(' 3. AGENTS.MD and .github/copilot-instructions.md are thin compatibility pointers'));
|
|
196
|
+
console.log(chalk.white(' 4. Configure your AI assistant (Copilot, Claude, etc.)'));
|
|
198
197
|
console.log(chalk.white(' 5. Adapt the rules to your technology stack\n'));
|
|
199
198
|
|
|
200
199
|
} catch (error) {
|
|
@@ -312,7 +311,6 @@ program
|
|
|
312
311
|
const targetDocsDir = path.join(targetDir, 'agent-docs');
|
|
313
312
|
await fs.ensureDir(targetDocsDir);
|
|
314
313
|
await copyDirectory(sourceDocsDir, targetDocsDir, options.force);
|
|
315
|
-
await copyFiles(templateDir, targetDir, [CORE_SOURCE_REL_PATH], options.force);
|
|
316
314
|
}
|
|
317
315
|
|
|
318
316
|
// Install agent rules
|
|
@@ -341,22 +339,20 @@ program
|
|
|
341
339
|
if (options.github) {
|
|
342
340
|
console.log(chalk.yellow('Installing AI agent instructions...'));
|
|
343
341
|
await fs.ensureDir(path.join(targetDir, '.github', 'instructions'));
|
|
344
|
-
await copyFiles(templateDir, targetDir, ['.cursorrules'], options.force);
|
|
345
342
|
await writeGeneratedInstructions(targetDir, templateDir, options.force);
|
|
346
|
-
console.log(chalk.gray(' ā
|
|
347
|
-
console.log(chalk.gray(' ā GitHub Copilot (.github/copilot-instructions.md
|
|
348
|
-
console.log(chalk.gray(' ā
|
|
349
|
-
console.log(chalk.gray(' ā Generic AGENTS (AGENTS.MD shim + canonical .github/instructions/AGENTS.md)'));
|
|
343
|
+
console.log(chalk.gray(' ā Claude (CLAUDE.md ā canonical source)'));
|
|
344
|
+
console.log(chalk.gray(' ā GitHub Copilot (.github/copilot-instructions.md pointer)'));
|
|
345
|
+
console.log(chalk.gray(' ā Generic AGENTS (AGENTS.MD pointer)'));
|
|
350
346
|
}
|
|
351
347
|
|
|
352
348
|
// Show summary and next steps
|
|
353
349
|
console.log(chalk.green.bold('\nā
Installation complete!\n'));
|
|
354
350
|
|
|
355
351
|
console.log(chalk.cyan('\nš Next Steps:\n'));
|
|
356
|
-
console.log(chalk.white(' 1. Review
|
|
352
|
+
console.log(chalk.white(' 1. Review CLAUDE.md (canonical AI policy ā edit this directly)'));
|
|
357
353
|
console.log(chalk.white(' 2. Review agent-docs/ARCHITECTURE.md for project guidelines'));
|
|
358
|
-
console.log(chalk.white(' 3.
|
|
359
|
-
console.log(chalk.white(' 4. Customize
|
|
354
|
+
console.log(chalk.white(' 3. AGENTS.MD and .github/copilot-instructions.md are thin pointers to CLAUDE.md'));
|
|
355
|
+
console.log(chalk.white(' 4. Customize agents/rules/*.mdc for your tech stack'));
|
|
360
356
|
|
|
361
357
|
console.log(chalk.cyan('\nš Security Reminder:\n'));
|
|
362
358
|
console.log(chalk.white(' ⢠Review agents/rules/security.mdc'));
|
|
@@ -403,12 +399,12 @@ program
|
|
|
403
399
|
let warnings = [];
|
|
404
400
|
let passed = [];
|
|
405
401
|
|
|
406
|
-
// Check canonical
|
|
407
|
-
const
|
|
408
|
-
if (await fs.pathExists(
|
|
409
|
-
passed.push(`ā ${
|
|
402
|
+
// Check canonical instruction file
|
|
403
|
+
const claudePath = path.join(targetDir, CANONICAL_INSTRUCTION_FILE);
|
|
404
|
+
if (await fs.pathExists(claudePath)) {
|
|
405
|
+
passed.push(`ā ${CANONICAL_INSTRUCTION_FILE} found (canonical policy source)`);
|
|
410
406
|
} else {
|
|
411
|
-
warnings.push(`ā ${
|
|
407
|
+
warnings.push(`ā ${CANONICAL_INSTRUCTION_FILE} missing - run 'agents-templated init --github'`);
|
|
412
408
|
}
|
|
413
409
|
|
|
414
410
|
const docFiles = ['ARCHITECTURE.md'];
|
|
@@ -466,37 +462,23 @@ program
|
|
|
466
462
|
warnings.push(`ā ${LAYOUT.canonical.skillsDir} directory missing - run 'agents-templated init --skills'`);
|
|
467
463
|
}
|
|
468
464
|
|
|
469
|
-
// Check
|
|
470
|
-
const
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
const instructionDrift = await validateInstructionDrift(targetDir);
|
|
478
|
-
if (instructionDrift.missingCore) {
|
|
479
|
-
issues.push(`ā Canonical instruction source missing - run 'agents-templated init --docs --github'`);
|
|
480
|
-
} else if (!instructionDrift.ok) {
|
|
481
|
-
issues.push(`ā Generated instruction files are out of sync: ${instructionDrift.driftFiles.join(', ')}`);
|
|
482
|
-
} else {
|
|
483
|
-
passed.push('ā Generated instruction files are in sync with canonical source');
|
|
484
|
-
}
|
|
465
|
+
// Check instruction pointer files and drift
|
|
466
|
+
const instructionDrift = await validateInstructionDrift(targetDir);
|
|
467
|
+
if (instructionDrift.missingCanonical) {
|
|
468
|
+
issues.push(`ā CLAUDE.md missing - run 'agents-templated init --github'`);
|
|
469
|
+
} else if (instructionDrift.driftFiles.length > 0) {
|
|
470
|
+
warnings.push(`ā Pointer files out of sync: ${instructionDrift.driftFiles.join(', ')} ā run 'agents-templated update --github'`);
|
|
471
|
+
} else {
|
|
472
|
+
passed.push('ā AGENTS.MD and .github/copilot-instructions.md are in sync');
|
|
485
473
|
}
|
|
486
474
|
|
|
487
|
-
const compatCopilotFile = path.join(targetDir,
|
|
475
|
+
const compatCopilotFile = path.join(targetDir, POINTER_FILES.copilot);
|
|
488
476
|
if (await fs.pathExists(compatCopilotFile)) {
|
|
489
477
|
passed.push(`ā GitHub Copilot configuration found`);
|
|
490
478
|
} else {
|
|
491
479
|
warnings.push(`ā GitHub Copilot configuration missing - run 'agents-templated init --github'`);
|
|
492
480
|
}
|
|
493
481
|
|
|
494
|
-
// Check for .cursorrules (if using Cursor)
|
|
495
|
-
const cursorrules = path.join(targetDir, '.cursorrules');
|
|
496
|
-
if (await fs.pathExists(cursorrules)) {
|
|
497
|
-
passed.push(`ā .cursorrules file found (Cursor IDE)`);
|
|
498
|
-
}
|
|
499
|
-
|
|
500
482
|
// Check for .gitignore
|
|
501
483
|
const gitignore = path.join(targetDir, '.gitignore');
|
|
502
484
|
if (await fs.pathExists(gitignore)) {
|
|
@@ -623,12 +605,19 @@ async function copyDirectory(sourceDir, targetDir, force = false) {
|
|
|
623
605
|
|
|
624
606
|
async function hasInstalledTemplates(targetDir) {
|
|
625
607
|
return await hasAnyLayout(targetDir) ||
|
|
626
|
-
await fs.pathExists(path.join(targetDir,
|
|
627
|
-
await fs.pathExists(path.join(targetDir,
|
|
608
|
+
await fs.pathExists(path.join(targetDir, CANONICAL_INSTRUCTION_FILE)) ||
|
|
609
|
+
await fs.pathExists(path.join(targetDir, POINTER_FILES.agents));
|
|
628
610
|
}
|
|
629
611
|
|
|
630
612
|
async function cleanupLegacyInstructionFiles(targetDir) {
|
|
631
|
-
|
|
613
|
+
// Files removed in v2.0.0: orphaned wrappers that contained duplicated policy
|
|
614
|
+
// content and were not managed/validated by the generator.
|
|
615
|
+
const legacyFiles = [
|
|
616
|
+
'.cursorrules',
|
|
617
|
+
'.github/instructions/AGENTS.md',
|
|
618
|
+
// Pre-v1.2.13 paths
|
|
619
|
+
'.claude/CLAUDE.md'
|
|
620
|
+
];
|
|
632
621
|
|
|
633
622
|
for (const file of legacyFiles) {
|
|
634
623
|
const filePath = path.join(targetDir, file);
|
|
@@ -652,7 +641,6 @@ async function updateSelectedComponents(targetDir, templateDir, selectedComponen
|
|
|
652
641
|
path.join(targetDir, 'agent-docs'),
|
|
653
642
|
overwrite
|
|
654
643
|
);
|
|
655
|
-
await copyFiles(templateDir, targetDir, [CORE_SOURCE_REL_PATH], overwrite);
|
|
656
644
|
}
|
|
657
645
|
|
|
658
646
|
if (components.includes('rules')) {
|
|
@@ -678,7 +666,6 @@ async function updateSelectedComponents(targetDir, templateDir, selectedComponen
|
|
|
678
666
|
if (components.includes('github')) {
|
|
679
667
|
console.log(chalk.yellow('Updating AI agent instructions...'));
|
|
680
668
|
await fs.ensureDir(path.join(targetDir, '.github', 'instructions'));
|
|
681
|
-
await copyFiles(templateDir, targetDir, ['.cursorrules'], overwrite);
|
|
682
669
|
await writeGeneratedInstructions(targetDir, templateDir, overwrite);
|
|
683
670
|
await cleanupLegacyInstructionFiles(targetDir);
|
|
684
671
|
}
|
|
@@ -788,15 +775,14 @@ program
|
|
|
788
775
|
// List potential updates
|
|
789
776
|
const updates = [];
|
|
790
777
|
const checkFiles = [
|
|
791
|
-
{ targetFile:
|
|
778
|
+
{ targetFile: CANONICAL_INSTRUCTION_FILE, templateFile: CANONICAL_INSTRUCTION_FILE, component: 'root' },
|
|
792
779
|
{ targetFile: 'agent-docs/ARCHITECTURE.md', templateFile: 'agent-docs/ARCHITECTURE.md', component: 'docs' },
|
|
793
780
|
{ targetFile: `${LAYOUT.canonical.rulesDir}/security.mdc`, templateFile: 'agents/rules/security.mdc', component: 'rules' },
|
|
794
781
|
{ targetFile: `${LAYOUT.canonical.rulesDir}/testing.mdc`, templateFile: 'agents/rules/testing.mdc', component: 'rules' },
|
|
795
782
|
{ targetFile: `${LAYOUT.canonical.rulesDir}/core.mdc`, templateFile: 'agents/rules/core.mdc', component: 'rules' },
|
|
796
783
|
{ targetFile: `${LAYOUT.canonical.skillsDir}/README.md`, templateFile: 'agents/skills/README.md', component: 'skills' },
|
|
797
784
|
{ targetFile: `${LAYOUT.canonical.skillsDir}/find-skills/SKILL.md`, templateFile: 'agents/skills/find-skills/SKILL.md', component: 'skills' },
|
|
798
|
-
{ targetFile: `${LAYOUT.canonical.skillsDir}/ui-ux-pro-max/SKILL.md`, templateFile: 'agents/skills/ui-ux-pro-max/SKILL.md', component: 'skills' }
|
|
799
|
-
{ targetFile: '.cursorrules', templateFile: '.cursorrules', component: 'github' }
|
|
785
|
+
{ targetFile: `${LAYOUT.canonical.skillsDir}/ui-ux-pro-max/SKILL.md`, templateFile: 'agents/skills/ui-ux-pro-max/SKILL.md', component: 'skills' }
|
|
800
786
|
];
|
|
801
787
|
|
|
802
788
|
for (const {targetFile, templateFile, component} of checkFiles) {
|
|
@@ -926,7 +912,6 @@ program
|
|
|
926
912
|
|
|
927
913
|
// Check AI assistant configs
|
|
928
914
|
const configs = [
|
|
929
|
-
{ file: '.cursorrules', name: 'Cursor IDE' },
|
|
930
915
|
{ file: '.github/copilot-instructions.md', name: 'GitHub Copilot' }
|
|
931
916
|
];
|
|
932
917
|
|
|
@@ -952,8 +937,40 @@ program
|
|
|
952
937
|
console.log(chalk.blue('\nš Quick Tips:\n'));
|
|
953
938
|
console.log(chalk.white(' ⢠Run "agents-templated validate" to check setup'));
|
|
954
939
|
console.log(chalk.white(' ⢠Run "agents-templated wizard" for guided setup'));
|
|
955
|
-
console.log(chalk.white(' ⢠Review
|
|
940
|
+
console.log(chalk.white(' ⢠Review agents/rules/security.mdc for security patterns\n'));
|
|
941
|
+
|
|
942
|
+
} catch (error) {
|
|
943
|
+
console.error(chalk.red('Error:'), error.message);
|
|
944
|
+
process.exit(1);
|
|
945
|
+
}
|
|
946
|
+
});
|
|
956
947
|
|
|
948
|
+
program
|
|
949
|
+
.command('new-skill <name>')
|
|
950
|
+
.description('Scaffold a new skill in agents/skills/<name>/SKILL.md')
|
|
951
|
+
.action(async (name) => {
|
|
952
|
+
try {
|
|
953
|
+
const targetDir = process.cwd();
|
|
954
|
+
const relPath = await scaffoldSkill(targetDir, name);
|
|
955
|
+
console.log(chalk.green(`\n+ ${relPath}\n`));
|
|
956
|
+
console.log(chalk.gray('Fill in Trigger Conditions, Workflow, and Output Contract.'));
|
|
957
|
+
console.log(chalk.gray('Then add it to the Reference Index in CLAUDE.md.\n'));
|
|
958
|
+
} catch (error) {
|
|
959
|
+
console.error(chalk.red('Error:'), error.message);
|
|
960
|
+
process.exit(1);
|
|
961
|
+
}
|
|
962
|
+
});
|
|
963
|
+
|
|
964
|
+
program
|
|
965
|
+
.command('new-rule <name>')
|
|
966
|
+
.description('Scaffold a new rule in agents/rules/<name>.mdc')
|
|
967
|
+
.action(async (name) => {
|
|
968
|
+
try {
|
|
969
|
+
const targetDir = process.cwd();
|
|
970
|
+
const relPath = await scaffoldRule(targetDir, name);
|
|
971
|
+
console.log(chalk.green(`\n+ ${relPath}\n`));
|
|
972
|
+
console.log(chalk.gray('Fill in Purpose and Requirements sections.'));
|
|
973
|
+
console.log(chalk.gray('Then add it to the Reference Index in CLAUDE.md.\n'));
|
|
957
974
|
} catch (error) {
|
|
958
975
|
console.error(chalk.red('Error:'), error.message);
|
|
959
976
|
process.exit(1);
|
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const fs = require('fs-extra');
|
|
2
2
|
const path = require('path');
|
|
3
3
|
const { LAYOUT } = require('./lib/layout');
|
|
4
|
-
const {
|
|
4
|
+
const { CANONICAL_INSTRUCTION_FILE, writeGeneratedInstructions } = require('./lib/instructions');
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Programmatic API for agents-templated
|
|
@@ -29,8 +29,7 @@ async function install(targetDir, options = {}) {
|
|
|
29
29
|
if (installAll || options.docs) {
|
|
30
30
|
files.push(
|
|
31
31
|
'agent-docs/ARCHITECTURE.md',
|
|
32
|
-
'agent-docs/README.md'
|
|
33
|
-
CORE_SOURCE_REL_PATH
|
|
32
|
+
'agent-docs/README.md'
|
|
34
33
|
);
|
|
35
34
|
}
|
|
36
35
|
|
|
@@ -72,13 +71,6 @@ async function install(targetDir, options = {}) {
|
|
|
72
71
|
// AI Agent instructions (Cursor, Copilot, Claude)
|
|
73
72
|
if (installAll || options.github) {
|
|
74
73
|
await fs.ensureDir(path.join(targetDir, '.github', 'instructions'));
|
|
75
|
-
|
|
76
|
-
const cursorSource = path.join(templateDir, '.cursorrules');
|
|
77
|
-
const cursorTarget = path.join(targetDir, '.cursorrules');
|
|
78
|
-
if (await fs.pathExists(cursorSource)) {
|
|
79
|
-
await fs.copy(cursorSource, cursorTarget, { overwrite: options.force });
|
|
80
|
-
}
|
|
81
|
-
|
|
82
74
|
await writeGeneratedInstructions(targetDir, templateDir, options.force);
|
|
83
75
|
}
|
|
84
76
|
}
|