agents-templated 1.2.8 → 1.2.10

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.
Files changed (33) hide show
  1. package/README.md +39 -9
  2. package/bin/cli.js +141 -177
  3. package/package.json +1 -1
  4. package/templates/.github/copilot-instructions.md +11 -3
  5. package/templates/AGENTS.MD +579 -2
  6. package/templates/CLAUDE.md +13 -4
  7. package/templates/GEMINI.md +15 -6
  8. package/templates/README.md +12 -4
  9. package/templates/agent-docs/ARCHITECTURE.md +1 -1
  10. package/templates/agent-docs/README.md +2 -2
  11. package/templates/agents/commands/README.md +24 -0
  12. package/templates/agents/commands/SCHEMA.md +22 -0
  13. package/templates/agents/commands/audit.md +38 -0
  14. package/templates/agents/commands/docs.md +34 -0
  15. package/templates/agents/commands/fix.md +34 -0
  16. package/templates/agents/commands/perf.md +34 -0
  17. package/templates/agents/commands/plan.md +34 -0
  18. package/templates/agents/commands/pr.md +35 -0
  19. package/templates/agents/commands/refactor.md +34 -0
  20. package/templates/agents/commands/release.md +39 -0
  21. package/templates/agents/commands/scaffold.md +34 -0
  22. package/templates/agents/commands/task.md +35 -0
  23. package/templates/agents/commands/test.md +34 -0
  24. package/templates/agents/rules/hardening.mdc +52 -0
  25. package/templates/agents/rules/intent-routing.mdc +45 -0
  26. package/templates/agents/rules/security.mdc +9 -1
  27. package/templates/agents/rules/system-workflow.mdc +63 -0
  28. package/templates/agents/rules/testing.mdc +14 -1
  29. package/templates/agents/rules/workflows.mdc +7 -0
  30. package/templates/agents/skills/README.md +13 -1
  31. package/templates/agents/skills/app-hardening/SKILL.md +45 -0
  32. package/templates/agents/skills/bug-triage/SKILL.md +36 -0
  33. package/templates/agents/skills/feature-delivery/SKILL.md +38 -0
package/README.md CHANGED
@@ -14,13 +14,29 @@
14
14
  Agents Templated scaffolds your project with:
15
15
 
16
16
  ✅ **AI Agent Configurations** – Auto-discovery files for 4 major AI coding assistants
17
+ ✅ **Deterministic Command Contracts** – Structured slash-command protocol in `agents/commands/`
17
18
  ✅ **Security-First Patterns** – OWASP Top 10 protection guidelines built-in
19
+ ✅ **Hardening Guidance** – Risk-based hardening/obfuscation and release evidence gates
18
20
  ✅ **Testing Strategy** – 80/15/5 coverage targets (unit/integration/e2e)
19
21
  ✅ **Agent-Based Architecture** – Specialized patterns for frontend, backend, database, testing, security
20
22
  ✅ **Technology-Agnostic** – Works with React, Django, Go, FastAPI, Next.js, or any stack you choose
21
23
 
22
24
  **Important:** This package does **NOT** install frameworks or libraries. It scaffolds the structure, patterns, and AI configurations—you install your chosen tech stack separately.
23
25
 
26
+ ### What’s New in This Version
27
+
28
+ - Deterministic slash-command standard in `AGENTS.MD` and modular contracts in `agents/commands/`
29
+ - Implicit natural-language routing support (`slash-command-auto`) for non-technical prompts
30
+ - New workflow/routing/hardening rule set:
31
+ - `agents/rules/intent-routing.mdc`
32
+ - `agents/rules/system-workflow.mdc`
33
+ - `agents/rules/hardening.mdc`
34
+ - New baseline skills:
35
+ - `agents/skills/feature-delivery/`
36
+ - `agents/skills/bug-triage/`
37
+ - `agents/skills/app-hardening/`
38
+ - Release and audit contracts now require hardening evidence when risk profile requires it
39
+
24
40
  ---
25
41
 
26
42
  ## 🚀 Quick Start
@@ -54,10 +70,6 @@ npx agents-templated@latest init --all
54
70
 
55
71
  After initializing, install your chosen framework:
56
72
 
57
- ### 2. Install Your Tech Stack
58
-
59
- After initializing, install your chosen framework:
60
-
61
73
  ```bash
62
74
  # Frontend
63
75
  npm install next react react-dom # Next.js
@@ -89,7 +101,10 @@ Your AI assistant will auto-load the configurations and follow enterprise patter
89
101
  | 🚀 **Quick Start Presets** | 5 popular tech stack presets (Next.js, Express, Django, FastAPI, Go) |
90
102
  | 🧙 **Interactive Wizard** | Guided setup with personalized recommendations |
91
103
  | 🤖 **4 AI Agents Supported** | Cursor, GitHub Copilot, Claude, Google Gemini (auto-discovery) |
104
+ | 🧭 **Deterministic Commands** | Slash-command contracts with strict structured outputs |
105
+ | 💬 **Auto Intent Routing** | Non-slash prompts can map to command contracts (`slash-command-auto`) |
92
106
  | 🔒 **Security-First** | OWASP Top 10 protection patterns built-in |
107
+ | 🛡️ **Hardening Workflow** | Risk-based hardening rules plus verification/release gates |
93
108
  | 🧪 **Testing Strategy** | 80/15/5 coverage targets (unit/integration/e2e) |
94
109
  | ✅ **Project Validation** | `validate` and `doctor` commands for health checks |
95
110
  | 🔄 **Template Updates** | Keep your templates in sync with `update` command |
@@ -109,7 +124,7 @@ Agents Templated automatically configures 4 major AI coding assistants:
109
124
  | **Claude** | `CLAUDE.md` | ✅ Auto-loads in Claude IDE/API |
110
125
  | **Gemini** | `GEMINI.md` | ✅ Auto-loads in Gemini IDE/API |
111
126
 
112
- **All agents follow the same rules:** `agents/rules/` directory contains unified patterns for security, testing, code style, and architecture. No duplication, one source of truth.
127
+ **All agents follow the same standards:** `agents/rules/` contains behavior rules, and `agents/commands/` contains deterministic slash-command contracts.
113
128
 
114
129
  ---
115
130
 
@@ -120,7 +135,7 @@ When you run `agents-templated init`, you get:
120
135
  ```
121
136
  your-project/
122
137
  ├── agent-docs/ # 📚 Comprehensive documentation
123
- │ ├── AGENTS.md # AI assistant guide
138
+ │ ├── AGENTS.MD # AI assistant guide
124
139
  │ ├── ARCHITECTURE.md # Project architecture & tech stack
125
140
  │ └── README.md # Human-readable setup guide
126
141
 
@@ -131,9 +146,24 @@ your-project/
131
146
  │ │ ├── testing.mdc # Testing strategy
132
147
  │ │ ├── frontend.mdc # Frontend patterns
133
148
  │ │ ├── database.mdc # Database patterns
134
- │ │ └── style.mdc # Code style guidelines
149
+ │ │ ├── style.mdc # Code style guidelines
150
+ │ │ ├── workflows.mdc # Workflow and quality gates
151
+ │ │ ├── intent-routing.mdc # Intent-to-command routing policy
152
+ │ │ ├── system-workflow.mdc # End-to-end delivery lifecycle gates
153
+ │ │ └── hardening.mdc # Hardening and obfuscation guidance
154
+ │ ├── commands/
155
+ │ │ ├── SCHEMA.md # Global slash-command response schema
156
+ │ │ ├── plan.md # /plan contract
157
+ │ │ ├── fix.md # /fix contract
158
+ │ │ ├── audit.md # /audit contract
159
+ │ │ ├── release.md # /release contract
160
+ │ │ ├── ... # Other command contracts
161
+ │ │ └── README.md # Commands directory guide
135
162
  │ └── skills/
136
163
  │ ├── find-skills/ # Skill discovery helper
164
+ │ ├── feature-delivery/ # Scoped feature delivery workflow
165
+ │ ├── bug-triage/ # Reproduction-first defect workflow
166
+ │ ├── app-hardening/ # Hardening and release-evidence workflow
137
167
  │ ├── ui-ux-pro-max/ # Advanced UI/UX design implementation skill
138
168
  │ ├── README.md # Guide for creating custom skills
139
169
  │ └── [your-custom-skills]/ # Your project-specific skills
@@ -261,7 +291,7 @@ Skills define *how to execute specific tasks*, complementing rules that define *
261
291
 
262
292
  ### 4. Read the Documentation
263
293
 
264
- - **[AGENTS.md](AGENTS.md)** – AI assistant guide
294
+ - **[AGENTS.MD](AGENTS.MD)** – AI assistant guide
265
295
  - **[agent-docs/ARCHITECTURE.md](agent-docs/ARCHITECTURE.md)** – Project architecture & tech stack guidance
266
296
  - **[agents/skills/README.md](agents/skills/README.md)** – Custom skills guide
267
297
  - **[agents/rules/security.mdc](agents/rules/security.mdc)** – Security patterns (CRITICAL)
@@ -311,7 +341,7 @@ Your AI will follow the enterprise patterns automatically!
311
341
  | **TestAgent** | Unit, integration, E2E, accessibility testing |
312
342
  | **SecurityAgent** | Input validation, authentication, OWASP compliance |
313
343
 
314
- **Reference**: [AGENTS.md](AGENTS.md)
344
+ **Reference**: [AGENTS.MD](AGENTS.MD)
315
345
 
316
346
  ---
317
347
 
package/bin/cli.js CHANGED
@@ -181,9 +181,9 @@ program
181
181
 
182
182
  console.log(chalk.green.bold('\nInstallation complete!\n'));
183
183
  console.log(chalk.cyan('Next steps:'));
184
- console.log(chalk.white(' 1. Review AGENTS.md for generic AI assistant guide'));
184
+ console.log(chalk.white(' 1. Review AGENTS.MD for generic AI assistant guide'));
185
185
  console.log(chalk.white(' 2. Review agent-docs/ARCHITECTURE.md for project guidelines'));
186
- console.log(chalk.white(' 3. Review AGENTS.md for AI assistant guide'));
186
+ console.log(chalk.white(' 3. Review AGENTS.MD for AI assistant guide'));
187
187
  console.log(chalk.white(' 4. Configure your AI assistant (Cursor, Copilot, etc.)'));
188
188
  console.log(chalk.white(' 5. Adapt the rules to your technology stack\n'));
189
189
 
@@ -195,89 +195,69 @@ program
195
195
 
196
196
  program
197
197
  .command('wizard')
198
- .description('Interactive setup wizard with tech stack recommendations')
198
+ .description('Interactive setup wizard')
199
199
  .action(async () => {
200
200
  try {
201
201
  const templateDir = getTemplatesDir();
202
+ const targetDir = process.cwd();
202
203
  console.log(chalk.blue.bold('\n🧙 Agents Templated Setup Wizard\n'));
203
204
  console.log(chalk.gray('Let\'s set up your project with the right patterns and guidelines.\n'));
204
205
 
205
- // Step 1: Tech stack selection
206
- const stackAnswers = await inquirer.prompt([
207
- {
208
- type: 'list',
209
- name: 'category',
210
- message: 'What type of project is this?',
211
- choices: [
212
- { name: '🌐 Full-stack Web Application', value: 'fullstack' },
213
- { name: '⚛️ Frontend Only', value: 'frontend' },
214
- { name: '🔧 Backend API', value: 'backend' },
215
- { name: '📦 NPM Package/Library', value: 'package' },
216
- { name: '🤖 CLI Tool', value: 'cli' },
217
- { name: '🎯 Custom/Other', value: 'custom' }
218
- ]
219
- }
220
- ]);
206
+ const hasExistingSetup = await hasInstalledTemplates(targetDir);
207
+ if (hasExistingSetup) {
208
+ console.log(chalk.cyan('Detected an existing agents-templated setup in this project.\n'));
221
209
 
222
- let techStack = {};
223
-
224
- if (stackAnswers.category === 'fullstack' || stackAnswers.category === 'frontend') {
225
- const frontendAnswers = await inquirer.prompt([
210
+ const modeAnswer = await inquirer.prompt([
226
211
  {
227
212
  type: 'list',
228
- name: 'framework',
229
- message: 'Which frontend framework?',
213
+ name: 'mode',
214
+ message: 'How would you like to proceed?',
230
215
  choices: [
231
- 'React / Next.js',
232
- 'Vue / Nuxt',
233
- 'Angular',
234
- 'Svelte / SvelteKit',
235
- 'Vanilla JS / HTML',
236
- 'Other'
237
- ]
216
+ { name: 'Update existing setup (recommended)', value: 'update' },
217
+ { name: 'Run full setup flow', value: 'setup' }
218
+ ],
219
+ default: 'update'
238
220
  }
239
221
  ]);
240
- techStack.frontend = frontendAnswers.framework;
241
- }
242
222
 
243
- if (stackAnswers.category === 'fullstack' || stackAnswers.category === 'backend') {
244
- const backendAnswers = await inquirer.prompt([
245
- {
246
- type: 'list',
247
- name: 'framework',
248
- message: 'Which backend framework?',
249
- choices: [
250
- 'Node.js (Express/Fastify)',
251
- 'Python (Django/FastAPI)',
252
- 'Go',
253
- 'Rust',
254
- 'Java / Spring Boot',
255
- 'Ruby on Rails',
256
- 'PHP (Laravel)',
257
- 'Other'
258
- ]
259
- },
260
- {
261
- type: 'list',
262
- name: 'database',
263
- message: 'Which database?',
264
- choices: [
265
- 'PostgreSQL',
266
- 'MySQL / MariaDB',
267
- 'MongoDB',
268
- 'SQLite',
269
- 'Supabase',
270
- 'Firebase',
271
- 'None / Not sure yet',
272
- 'Other'
273
- ]
274
- }
275
- ]);
276
- techStack.backend = backendAnswers.framework;
277
- techStack.database = backendAnswers.database;
223
+ if (modeAnswer.mode === 'update') {
224
+ const updateAnswers = await inquirer.prompt([
225
+ {
226
+ type: 'checkbox',
227
+ name: 'components',
228
+ message: 'Select components to update:',
229
+ choices: [
230
+ { name: 'All components', value: 'all', checked: true },
231
+ { name: 'Documentation (agent-docs/)', value: 'docs' },
232
+ { name: 'Agent Rules (security, testing, database, etc.)', value: 'rules' },
233
+ { name: 'Skills (reusable agent capabilities)', value: 'skills' },
234
+ { name: 'AI Agent instructions (Cursor, Copilot, VSCode, Gemini)', value: 'github' }
235
+ ],
236
+ validate: (answer) => {
237
+ if (answer.length === 0) {
238
+ return 'You must choose at least one component.';
239
+ }
240
+ return true;
241
+ }
242
+ },
243
+ {
244
+ type: 'confirm',
245
+ name: 'overwrite',
246
+ message: 'Overwrite existing files while updating?',
247
+ default: true
248
+ }
249
+ ]);
250
+
251
+ console.log(chalk.blue('\n📦 Updating selected components...\n'));
252
+ await updateSelectedComponents(targetDir, templateDir, updateAnswers.components, updateAnswers.overwrite);
253
+
254
+ console.log(chalk.green.bold('\n✅ Update complete!\n'));
255
+ console.log(chalk.gray('Tip: run "agents-templated validate" to verify your setup.\n'));
256
+ return;
257
+ }
278
258
  }
279
259
 
280
- // Step 2: Component selection
260
+ // Component selection
281
261
  const componentAnswers = await inquirer.prompt([
282
262
  {
283
263
  type: 'checkbox',
@@ -307,7 +287,6 @@ program
307
287
  // Step 3: Install components
308
288
  console.log(chalk.blue('\n📦 Installing components...\n'));
309
289
 
310
- const targetDir = process.cwd();
311
290
  const options = {
312
291
  force: componentAnswers.overwrite,
313
292
  docs: componentAnswers.components.includes('docs'),
@@ -354,60 +333,25 @@ program
354
333
  await copyFiles(templateDir, targetDir, [
355
334
  '.cursorrules',
356
335
  '.github/copilot-instructions.md',
357
- 'AGENTS.md',
336
+ 'AGENTS.MD',
358
337
  'CLAUDE.md',
359
338
  'GEMINI.md'
360
339
  ], options.force);
361
340
  console.log(chalk.gray(' ✓ Cursor (.cursorrules)'));
362
341
  console.log(chalk.gray(' ✓ GitHub Copilot (.github/copilot-instructions.md)'));
363
- console.log(chalk.gray(' ✓ Generic AI (AGENTS.md)'));
342
+ console.log(chalk.gray(' ✓ Generic AI (AGENTS.MD)'));
364
343
  console.log(chalk.gray(' ✓ Claude (CLAUDE.md)'));
365
344
  console.log(chalk.gray(' ✓ Google Gemini (GEMINI.md)'));
366
345
  }
367
346
 
368
- // Step 4: Show recommendations
347
+ // Show summary and next steps
369
348
  console.log(chalk.green.bold('\n✅ Installation complete!\n'));
370
349
 
371
- console.log(chalk.blue('📋 Your Project Setup:\n'));
372
- if (techStack.frontend) console.log(chalk.white(` Frontend: ${techStack.frontend}`));
373
- if (techStack.backend) console.log(chalk.white(` Backend: ${techStack.backend}`));
374
- if (techStack.database) console.log(chalk.white(` Database: ${techStack.database}`));
375
-
376
350
  console.log(chalk.cyan('\n📚 Next Steps:\n'));
377
- console.log(chalk.white(' 1. Review AGENTS.md for AI assistant guide'));
351
+ console.log(chalk.white(' 1. Review AGENTS.MD for AI assistant guide'));
378
352
  console.log(chalk.white(' 2. Review agent-docs/ARCHITECTURE.md for project guidelines'));
379
- console.log(chalk.white(' 3. Review AGENTS.md for AI assistant guide'));
380
- console.log(chalk.white(' 3. Customize agents/rules/*.mdc for your tech stack'));
381
-
382
- if (techStack.frontend || techStack.backend) {
383
- console.log(chalk.cyan('\n📦 Recommended Packages:\n'));
384
-
385
- if (techStack.frontend?.includes('React')) {
386
- console.log(chalk.white(' npm install react react-dom next typescript'));
387
- console.log(chalk.white(' npm install -D @types/react @types/node'));
388
- } else if (techStack.frontend?.includes('Vue')) {
389
- console.log(chalk.white(' npm install vue nuxt typescript'));
390
- } else if (techStack.frontend?.includes('Svelte')) {
391
- console.log(chalk.white(' npm install svelte @sveltejs/kit typescript'));
392
- }
393
-
394
- if (techStack.backend?.includes('Node.js')) {
395
- console.log(chalk.white(' npm install express zod dotenv'));
396
- console.log(chalk.white(' npm install -D @types/express'));
397
- } else if (techStack.backend?.includes('Python')) {
398
- console.log(chalk.white(' pip install django djangorestframework pydantic'));
399
- } else if (techStack.backend?.includes('Go')) {
400
- console.log(chalk.white(' go get github.com/gin-gonic/gin'));
401
- }
402
-
403
- if (techStack.database?.includes('PostgreSQL')) {
404
- console.log(chalk.white(' npm install @prisma/client (or) npm install pg'));
405
- } else if (techStack.database?.includes('MongoDB')) {
406
- console.log(chalk.white(' npm install mongoose'));
407
- } else if (techStack.database?.includes('Supabase')) {
408
- console.log(chalk.white(' npm install @supabase/supabase-js'));
409
- }
410
- }
353
+ console.log(chalk.white(' 3. Review AGENTS.MD for AI assistant guide'));
354
+ console.log(chalk.white(' 4. Customize agents/rules/*.mdc for your tech stack'));
411
355
 
412
356
  console.log(chalk.cyan('\n🔒 Security Reminder:\n'));
413
357
  console.log(chalk.white(' • Review agents/rules/security.mdc'));
@@ -455,10 +399,12 @@ program
455
399
  let passed = [];
456
400
 
457
401
  // Check documentation files
458
- if (await fs.pathExists(path.join(targetDir, 'AGENTS.md'))) {
459
- passed.push(`✓ AGENTS.md found`);
402
+ if (await fs.pathExists(path.join(targetDir, 'AGENTS.MD'))) {
403
+ passed.push(`✓ AGENTS.MD found`);
404
+ } else if (await fs.pathExists(path.join(targetDir, 'AGENTS.md'))) {
405
+ passed.push(`✓ AGENTS.md found (legacy filename)`);
460
406
  } else {
461
- warnings.push(`⚠ AGENTS.md missing - run 'agents-templated init --docs'`);
407
+ warnings.push(`⚠ AGENTS.MD missing - run 'agents-templated init --docs'`);
462
408
  }
463
409
 
464
410
  const docFiles = ['ARCHITECTURE.md'];
@@ -639,6 +585,60 @@ async function copyDirectory(sourceDir, targetDir, force = false) {
639
585
  }
640
586
  }
641
587
 
588
+ async function hasInstalledTemplates(targetDir) {
589
+ return await fs.pathExists(path.join(targetDir, 'AGENTS.MD')) ||
590
+ await fs.pathExists(path.join(targetDir, 'AGENTS.md')) ||
591
+ await fs.pathExists(path.join(targetDir, 'agents'));
592
+ }
593
+
594
+ async function updateSelectedComponents(targetDir, templateDir, selectedComponents, overwrite = true) {
595
+ const components = selectedComponents.includes('all')
596
+ ? ['docs', 'rules', 'skills', 'github']
597
+ : selectedComponents;
598
+
599
+ if (components.includes('docs')) {
600
+ console.log(chalk.yellow('Updating documentation files...'));
601
+ await fs.ensureDir(path.join(targetDir, 'agent-docs'));
602
+ await copyDirectory(
603
+ path.join(templateDir, 'agent-docs'),
604
+ path.join(targetDir, 'agent-docs'),
605
+ overwrite
606
+ );
607
+ }
608
+
609
+ if (components.includes('rules')) {
610
+ console.log(chalk.yellow('Updating agent rules...'));
611
+ await fs.ensureDir(path.join(targetDir, 'agents', 'rules'));
612
+ await copyDirectory(
613
+ path.join(templateDir, 'agents', 'rules'),
614
+ path.join(targetDir, 'agents', 'rules'),
615
+ overwrite
616
+ );
617
+ }
618
+
619
+ if (components.includes('skills')) {
620
+ console.log(chalk.yellow('Updating skills...'));
621
+ await fs.ensureDir(path.join(targetDir, 'agents', 'skills'));
622
+ await copyDirectory(
623
+ path.join(templateDir, 'agents', 'skills'),
624
+ path.join(targetDir, 'agents', 'skills'),
625
+ overwrite
626
+ );
627
+ }
628
+
629
+ if (components.includes('github')) {
630
+ console.log(chalk.yellow('Updating AI agent instructions...'));
631
+ await fs.ensureDir(path.join(targetDir, '.github'));
632
+ await copyFiles(templateDir, targetDir, [
633
+ '.cursorrules',
634
+ '.github/copilot-instructions.md',
635
+ 'AGENTS.MD',
636
+ 'CLAUDE.md',
637
+ 'GEMINI.md'
638
+ ], overwrite);
639
+ }
640
+ }
641
+
642
642
  program
643
643
  .command('update')
644
644
  .description('Check for and apply template updates')
@@ -657,8 +657,7 @@ program
657
657
  console.log(chalk.blue.bold('\n🔄 Checking for template updates...\n'));
658
658
 
659
659
  // Check if templates are installed
660
- const hasTemplates = await fs.pathExists(path.join(targetDir, 'AGENTS.md')) ||
661
- await fs.pathExists(path.join(targetDir, 'agents'));
660
+ const hasTemplates = await hasInstalledTemplates(targetDir);
662
661
 
663
662
  if (!hasTemplates) {
664
663
  console.log(chalk.yellow('No templates detected in this directory.'));
@@ -678,46 +677,7 @@ program
678
677
 
679
678
  console.log(chalk.blue('📦 Updating selected components...\n'));
680
679
 
681
- if (selectedComponents.includes('docs')) {
682
- console.log(chalk.yellow('Updating documentation files...'));
683
- await fs.ensureDir(path.join(targetDir, 'agent-docs'));
684
- await copyDirectory(
685
- path.join(templateDir, 'agent-docs'),
686
- path.join(targetDir, 'agent-docs'),
687
- true
688
- );
689
- }
690
-
691
- if (selectedComponents.includes('rules')) {
692
- console.log(chalk.yellow('Updating agent rules...'));
693
- await fs.ensureDir(path.join(targetDir, 'agents', 'rules'));
694
- await copyDirectory(
695
- path.join(templateDir, 'agents', 'rules'),
696
- path.join(targetDir, 'agents', 'rules'),
697
- true
698
- );
699
- }
700
-
701
- if (selectedComponents.includes('skills')) {
702
- console.log(chalk.yellow('Updating skills...'));
703
- await fs.ensureDir(path.join(targetDir, 'agents', 'skills'));
704
- await copyDirectory(
705
- path.join(templateDir, 'agents', 'skills'),
706
- path.join(targetDir, 'agents', 'skills'),
707
- true
708
- );
709
- }
710
-
711
- if (selectedComponents.includes('github')) {
712
- console.log(chalk.yellow('Updating AI agent instructions...'));
713
- await fs.ensureDir(path.join(targetDir, '.github'));
714
- await copyFiles(templateDir, targetDir, [
715
- '.cursorrules',
716
- '.github/copilot-instructions.md',
717
- 'CLAUDE.md',
718
- 'GEMINI.md'
719
- ], true);
720
- }
680
+ await updateSelectedComponents(targetDir, templateDir, selectedComponents, true);
721
681
 
722
682
  console.log(chalk.green.bold('\n✅ Selected component updates applied successfully!\n'));
723
683
  process.exit(0);
@@ -725,28 +685,32 @@ program
725
685
 
726
686
  // List potential updates
727
687
  const updates = [];
688
+ const rootAgentsTargetFile = (await fs.pathExists(path.join(targetDir, 'AGENTS.MD')))
689
+ ? 'AGENTS.MD'
690
+ : ((await fs.pathExists(path.join(targetDir, 'AGENTS.md'))) ? 'AGENTS.md' : 'AGENTS.MD');
691
+
728
692
  const checkFiles = [
729
- { file: 'AGENTS.md', component: 'root' },
730
- { file: 'agent-docs/ARCHITECTURE.md', component: 'docs' },
731
- { file: 'agents/rules/security.mdc', component: 'rules' },
732
- { file: 'agents/rules/testing.mdc', component: 'rules' },
733
- { file: 'agents/rules/core.mdc', component: 'rules' },
734
- { file: 'agents/skills/README.md', component: 'skills' },
735
- { file: 'agents/skills/find-skills/SKILL.md', component: 'skills' },
736
- { file: 'agents/skills/ui-ux-pro-max/SKILL.md', component: 'skills' },
737
- { file: '.github/copilot-instructions.md', component: 'github' }
693
+ { targetFile: rootAgentsTargetFile, templateFile: 'AGENTS.MD', component: 'root' },
694
+ { targetFile: 'agent-docs/ARCHITECTURE.md', templateFile: 'agent-docs/ARCHITECTURE.md', component: 'docs' },
695
+ { targetFile: 'agents/rules/security.mdc', templateFile: 'agents/rules/security.mdc', component: 'rules' },
696
+ { targetFile: 'agents/rules/testing.mdc', templateFile: 'agents/rules/testing.mdc', component: 'rules' },
697
+ { targetFile: 'agents/rules/core.mdc', templateFile: 'agents/rules/core.mdc', component: 'rules' },
698
+ { targetFile: 'agents/skills/README.md', templateFile: 'agents/skills/README.md', component: 'skills' },
699
+ { targetFile: 'agents/skills/find-skills/SKILL.md', templateFile: 'agents/skills/find-skills/SKILL.md', component: 'skills' },
700
+ { targetFile: 'agents/skills/ui-ux-pro-max/SKILL.md', templateFile: 'agents/skills/ui-ux-pro-max/SKILL.md', component: 'skills' },
701
+ { targetFile: '.github/copilot-instructions.md', templateFile: '.github/copilot-instructions.md', component: 'github' }
738
702
  ];
739
703
 
740
- for (const {file, component} of checkFiles) {
741
- const targetPath = path.join(targetDir, file);
742
- const templatePath = path.join(templateDir, file);
704
+ for (const {targetFile, templateFile, component} of checkFiles) {
705
+ const targetPath = path.join(targetDir, targetFile);
706
+ const templatePath = path.join(templateDir, templateFile);
743
707
 
744
708
  if (await fs.pathExists(targetPath) && await fs.pathExists(templatePath)) {
745
709
  const targetContent = await fs.readFile(targetPath, 'utf8');
746
710
  const templateContent = await fs.readFile(templatePath, 'utf8');
747
711
 
748
712
  if (targetContent !== templateContent) {
749
- updates.push({ file, component });
713
+ updates.push({ targetFile, templateFile, component });
750
714
  }
751
715
  }
752
716
  }
@@ -757,8 +721,8 @@ program
757
721
  }
758
722
 
759
723
  console.log(chalk.yellow(`Found ${updates.length} file(s) with updates available:\n`));
760
- updates.forEach(({ file }) => {
761
- console.log(chalk.white(` 📄 ${file}`));
724
+ updates.forEach(({ targetFile }) => {
725
+ console.log(chalk.white(` 📄 ${targetFile}`));
762
726
  });
763
727
  console.log('');
764
728
 
@@ -785,18 +749,18 @@ program
785
749
  // Apply updates
786
750
  console.log(chalk.blue('\n📦 Applying updates...\n'));
787
751
 
788
- for (const { file } of updates) {
789
- const targetPath = path.join(targetDir, file);
790
- const templatePath = path.join(templateDir, file);
752
+ for (const { targetFile, templateFile } of updates) {
753
+ const targetPath = path.join(targetDir, targetFile);
754
+ const templatePath = path.join(templateDir, templateFile);
791
755
 
792
756
  // Backup original file
793
757
  const backupPath = `${targetPath}.backup`;
794
758
  await fs.copy(targetPath, backupPath);
795
- console.log(chalk.gray(` Backed up: ${file}.backup`));
759
+ console.log(chalk.gray(` Backed up: ${targetFile}.backup`));
796
760
 
797
761
  // Copy new version
798
762
  await fs.copy(templatePath, targetPath, { overwrite: true });
799
- console.log(chalk.green(` ✓ Updated: ${file}`));
763
+ console.log(chalk.green(` ✓ Updated: ${targetFile}`));
800
764
  }
801
765
 
802
766
  console.log(chalk.green.bold('\n✅ Updates applied successfully!\n'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agents-templated",
3
- "version": "1.2.8",
3
+ "version": "1.2.10",
4
4
  "description": "Technology-agnostic development template with multi-AI agent support (Cursor, Copilot, VSCode, Gemini), security-first patterns, and comprehensive testing guidelines",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -22,13 +22,21 @@ This project follows enterprise-grade, technology-agnostic development patterns.
22
22
 
23
23
  ## Agent Delegation
24
24
 
25
- When implementing features, follow agent patterns from `agent-docs/AGENTS.md`:
25
+ When implementing features, follow agent patterns from `AGENTS.MD`:
26
26
  - **UI/Design** → FrontendAgent patterns (`agents/rules/frontend.mdc`)
27
27
  - **API/Logic** → BackendAgent patterns (`agents/rules/security.mdc`)
28
28
  - **Database** → DatabaseAgent patterns (`agents/rules/database.mdc`)
29
29
  - **Testing** → TestAgent patterns (`agents/rules/testing.mdc`)
30
30
  - **Security** → SecurityAgent patterns (`agents/rules/security.mdc`)
31
31
 
32
+ ## Deterministic Slash Commands
33
+
34
+ - Slash command protocol is defined in `AGENTS.MD` under `Deterministic Slash Command System Standard`.
35
+ - Modular command contracts are stored in `agents/commands/`.
36
+ - Command mode is strict: unknown or malformed slash commands must return structured error output and stop.
37
+ - No conversational fallback is allowed once slash-command mode is entered.
38
+ - Destructive actions require explicit confirmation token format: `CONFIRM-DESTRUCTIVE:<target>`.
39
+
32
40
  ## Critical Rules
33
41
 
34
42
  - Validate ALL user inputs with schema validation
@@ -41,9 +49,9 @@ When implementing features, follow agent patterns from `agent-docs/AGENTS.md`:
41
49
 
42
50
  ## Reference Files
43
51
 
44
- - `agent-docs/AI_INSTRUCTIONS.md` - Primary AI assistant guide
52
+ - `AGENTS.MD` - Primary AI assistant guide
45
53
  - `agent-docs/ARCHITECTURE.md` - Architecture and technology stack guidance
46
- - `agent-docs/AGENTS.md` - Agent responsibilities and delegation
54
+ - `agents/commands/` - Deterministic slash command contracts
47
55
  - `agents/rules/core.mdc` - Core principles
48
56
  - `agents/rules/security.mdc` - Security patterns (CRITICAL)
49
57
  - `agents/rules/testing.mdc` - Testing strategy (CRITICAL)