agents-templated 1.2.12 → 2.0.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 +18 -9
- package/index.js +0 -7
- package/lib/instructions.js +45 -15
- package/package.json +1 -1
- package/templates/.cursorrules +9 -70
- package/templates/.github/copilot-instructions.md +7 -62
- package/templates/AGENTS.md +9 -0
- package/templates/CLAUDE.md +9 -65
- 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/skills/README.md +0 -7
- 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
|
@@ -16,6 +16,7 @@ const {
|
|
|
16
16
|
const {
|
|
17
17
|
CORE_SOURCE_REL_PATH,
|
|
18
18
|
GENERATED_INSTRUCTION_PATHS,
|
|
19
|
+
KNOWN_ORPHAN_PATHS,
|
|
19
20
|
writeGeneratedInstructions,
|
|
20
21
|
validateInstructionDrift
|
|
21
22
|
} = require('../lib/instructions');
|
|
@@ -181,11 +182,10 @@ 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
186
|
console.log(chalk.gray(' ✓ Cursor (.cursorrules)'));
|
|
187
187
|
console.log(chalk.gray(' ✓ GitHub Copilot (.github/copilot-instructions.md shim)'));
|
|
188
|
-
console.log(chalk.gray(' ✓ Claude (
|
|
188
|
+
console.log(chalk.gray(' ✓ Claude (CLAUDE.md shim)'));
|
|
189
189
|
console.log(chalk.gray(' ✓ Generic AGENTS (AGENTS.MD shim + canonical .github/instructions/AGENTS.md)'));
|
|
190
190
|
}
|
|
191
191
|
|
|
@@ -341,11 +341,10 @@ program
|
|
|
341
341
|
if (options.github) {
|
|
342
342
|
console.log(chalk.yellow('Installing AI agent instructions...'));
|
|
343
343
|
await fs.ensureDir(path.join(targetDir, '.github', 'instructions'));
|
|
344
|
-
await copyFiles(templateDir, targetDir, ['.cursorrules'], options.force);
|
|
345
344
|
await writeGeneratedInstructions(targetDir, templateDir, options.force);
|
|
346
345
|
console.log(chalk.gray(' ✓ Cursor (.cursorrules)'));
|
|
347
346
|
console.log(chalk.gray(' ✓ GitHub Copilot (.github/copilot-instructions.md shim)'));
|
|
348
|
-
console.log(chalk.gray(' ✓ Claude (
|
|
347
|
+
console.log(chalk.gray(' ✓ Claude (CLAUDE.md shim)'));
|
|
349
348
|
console.log(chalk.gray(' ✓ Generic AGENTS (AGENTS.MD shim + canonical .github/instructions/AGENTS.md)'));
|
|
350
349
|
}
|
|
351
350
|
|
|
@@ -477,11 +476,17 @@ program
|
|
|
477
476
|
const instructionDrift = await validateInstructionDrift(targetDir);
|
|
478
477
|
if (instructionDrift.missingCore) {
|
|
479
478
|
issues.push(`✗ Canonical instruction source missing - run 'agents-templated init --docs --github'`);
|
|
480
|
-
} else if (
|
|
479
|
+
} else if (instructionDrift.driftFiles.length > 0) {
|
|
481
480
|
issues.push(`✗ Generated instruction files are out of sync: ${instructionDrift.driftFiles.join(', ')}`);
|
|
482
481
|
} else {
|
|
483
482
|
passed.push('✓ Generated instruction files are in sync with canonical source');
|
|
484
483
|
}
|
|
484
|
+
if (instructionDrift.orphanedPolicyFiles && instructionDrift.orphanedPolicyFiles.length > 0) {
|
|
485
|
+
issues.push(
|
|
486
|
+
`✗ Orphaned policy files detected (contain duplicated content, should be deleted): ` +
|
|
487
|
+
`${instructionDrift.orphanedPolicyFiles.join(', ')} — run 'agents-templated update --github' to remove`
|
|
488
|
+
);
|
|
489
|
+
}
|
|
485
490
|
}
|
|
486
491
|
|
|
487
492
|
const compatCopilotFile = path.join(targetDir, GENERATED_INSTRUCTION_PATHS.compatibility.copilot);
|
|
@@ -628,7 +633,13 @@ async function hasInstalledTemplates(targetDir) {
|
|
|
628
633
|
}
|
|
629
634
|
|
|
630
635
|
async function cleanupLegacyInstructionFiles(targetDir) {
|
|
631
|
-
|
|
636
|
+
// Files removed in v2.0.0: orphaned wrappers that contained duplicated policy
|
|
637
|
+
// content and were not managed/validated by the generator.
|
|
638
|
+
const legacyFiles = [
|
|
639
|
+
...KNOWN_ORPHAN_PATHS,
|
|
640
|
+
// Pre-v1.2.13 paths
|
|
641
|
+
'.claude/CLAUDE.md'
|
|
642
|
+
];
|
|
632
643
|
|
|
633
644
|
for (const file of legacyFiles) {
|
|
634
645
|
const filePath = path.join(targetDir, file);
|
|
@@ -678,7 +689,6 @@ async function updateSelectedComponents(targetDir, templateDir, selectedComponen
|
|
|
678
689
|
if (components.includes('github')) {
|
|
679
690
|
console.log(chalk.yellow('Updating AI agent instructions...'));
|
|
680
691
|
await fs.ensureDir(path.join(targetDir, '.github', 'instructions'));
|
|
681
|
-
await copyFiles(templateDir, targetDir, ['.cursorrules'], overwrite);
|
|
682
692
|
await writeGeneratedInstructions(targetDir, templateDir, overwrite);
|
|
683
693
|
await cleanupLegacyInstructionFiles(targetDir);
|
|
684
694
|
}
|
|
@@ -795,8 +805,7 @@ program
|
|
|
795
805
|
{ targetFile: `${LAYOUT.canonical.rulesDir}/core.mdc`, templateFile: 'agents/rules/core.mdc', component: 'rules' },
|
|
796
806
|
{ targetFile: `${LAYOUT.canonical.skillsDir}/README.md`, templateFile: 'agents/skills/README.md', component: 'skills' },
|
|
797
807
|
{ 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' }
|
|
808
|
+
{ targetFile: `${LAYOUT.canonical.skillsDir}/ui-ux-pro-max/SKILL.md`, templateFile: 'agents/skills/ui-ux-pro-max/SKILL.md', component: 'skills' }
|
|
800
809
|
];
|
|
801
810
|
|
|
802
811
|
for (const {targetFile, templateFile, component} of checkFiles) {
|
package/index.js
CHANGED
|
@@ -72,13 +72,6 @@ async function install(targetDir, options = {}) {
|
|
|
72
72
|
// AI Agent instructions (Cursor, Copilot, Claude)
|
|
73
73
|
if (installAll || options.github) {
|
|
74
74
|
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
75
|
await writeGeneratedInstructions(targetDir, templateDir, options.force);
|
|
83
76
|
}
|
|
84
77
|
}
|
package/lib/instructions.js
CHANGED
|
@@ -10,10 +10,22 @@ const GENERATED_INSTRUCTION_PATHS = {
|
|
|
10
10
|
compatibility: {
|
|
11
11
|
generic: 'AGENTS.MD',
|
|
12
12
|
copilot: '.github/copilot-instructions.md',
|
|
13
|
-
claude: '
|
|
13
|
+
claude: 'CLAUDE.md',
|
|
14
|
+
cursor: '.cursorrules'
|
|
14
15
|
}
|
|
15
16
|
};
|
|
16
17
|
|
|
18
|
+
// Files that MUST NOT exist — legacy/orphaned files that contain or may contain
|
|
19
|
+
// duplicated policy content. Their presence is reported as a violation by validateInstructionDrift.
|
|
20
|
+
const KNOWN_ORPHAN_PATHS = [
|
|
21
|
+
'.github/instructions/CLAUDE.md',
|
|
22
|
+
'.github/instructions/GEMINI.md',
|
|
23
|
+
'.github/instructions/agents.instructions.md',
|
|
24
|
+
'.github/instructions/copilot-instructions.md',
|
|
25
|
+
'.claude/rules/claude.instructions.md',
|
|
26
|
+
'GEMINI.md'
|
|
27
|
+
];
|
|
28
|
+
|
|
17
29
|
function getLegacyCoreCandidates() {
|
|
18
30
|
return ['AGENTS.MD', 'AGENTS.md'];
|
|
19
31
|
}
|
|
@@ -31,27 +43,30 @@ function buildCompatInstruction(toolName, corePath) {
|
|
|
31
43
|
const titles = {
|
|
32
44
|
generic: '# AGENTS Instructions',
|
|
33
45
|
copilot: '# GitHub Copilot Instructions',
|
|
34
|
-
claude: '# Claude Instructions'
|
|
46
|
+
claude: '# Claude Instructions',
|
|
47
|
+
cursor: '# Cursor Rules'
|
|
35
48
|
};
|
|
36
49
|
|
|
37
50
|
return [
|
|
38
51
|
`${titles[toolName]}`,
|
|
39
52
|
'',
|
|
40
53
|
`Primary policy source: \`${corePath}\`.`,
|
|
41
|
-
'
|
|
42
|
-
'
|
|
54
|
+
'Load policy only from the canonical source file above.',
|
|
55
|
+
'Do not duplicate, summarize, or inline rules in this file.',
|
|
56
|
+
'If this file and the canonical source conflict, the canonical source wins.',
|
|
43
57
|
''
|
|
44
58
|
].join('\n');
|
|
45
59
|
}
|
|
46
60
|
|
|
47
|
-
function buildGeneratedArtifacts(
|
|
61
|
+
function buildGeneratedArtifacts() {
|
|
48
62
|
const corePath = CORE_SOURCE_REL_PATH;
|
|
49
63
|
const files = {};
|
|
50
64
|
|
|
51
|
-
files[GENERATED_INSTRUCTION_PATHS.canonical.generic] = `${buildHeaders('generic')}${
|
|
65
|
+
files[GENERATED_INSTRUCTION_PATHS.canonical.generic] = `${buildHeaders('generic-wrapper')}${buildCompatInstruction('generic', corePath)}`;
|
|
52
66
|
files[GENERATED_INSTRUCTION_PATHS.compatibility.generic] = `${buildHeaders('generic-compat')}${buildCompatInstruction('generic', corePath)}`;
|
|
53
67
|
files[GENERATED_INSTRUCTION_PATHS.compatibility.copilot] = `${buildHeaders('copilot-compat')}${buildCompatInstruction('copilot', corePath)}`;
|
|
54
68
|
files[GENERATED_INSTRUCTION_PATHS.compatibility.claude] = `${buildHeaders('claude-compat')}${buildCompatInstruction('claude', corePath)}`;
|
|
69
|
+
files[GENERATED_INSTRUCTION_PATHS.compatibility.cursor] = `${buildHeaders('cursor-compat')}${buildCompatInstruction('cursor', corePath)}`;
|
|
55
70
|
|
|
56
71
|
return files;
|
|
57
72
|
}
|
|
@@ -65,7 +80,14 @@ async function resolveCoreContent(targetDir, templateDir) {
|
|
|
65
80
|
for (const legacyFile of getLegacyCoreCandidates()) {
|
|
66
81
|
const legacyPath = path.join(targetDir, legacyFile);
|
|
67
82
|
if (await fs.pathExists(legacyPath)) {
|
|
68
|
-
|
|
83
|
+
const legacyContent = await fs.readFile(legacyPath, 'utf8');
|
|
84
|
+
const isWrapper =
|
|
85
|
+
legacyContent.includes(`Source of truth: ${CORE_SOURCE_REL_PATH}`) ||
|
|
86
|
+
legacyContent.includes('Primary policy source: `instructions/source/core.md`.');
|
|
87
|
+
|
|
88
|
+
if (!isWrapper) {
|
|
89
|
+
return legacyContent;
|
|
90
|
+
}
|
|
69
91
|
}
|
|
70
92
|
}
|
|
71
93
|
|
|
@@ -87,9 +109,7 @@ async function ensureCoreSource(targetDir, templateDir, force = false) {
|
|
|
87
109
|
|
|
88
110
|
async function writeGeneratedInstructions(targetDir, templateDir, force = false) {
|
|
89
111
|
await ensureCoreSource(targetDir, templateDir, force);
|
|
90
|
-
const
|
|
91
|
-
const coreContent = await fs.readFile(corePath, 'utf8');
|
|
92
|
-
const artifacts = buildGeneratedArtifacts(coreContent);
|
|
112
|
+
const artifacts = buildGeneratedArtifacts();
|
|
93
113
|
|
|
94
114
|
for (const [relPath, content] of Object.entries(artifacts)) {
|
|
95
115
|
const targetPath = path.join(targetDir, relPath);
|
|
@@ -109,12 +129,12 @@ async function validateInstructionDrift(targetDir) {
|
|
|
109
129
|
return {
|
|
110
130
|
ok: false,
|
|
111
131
|
missingCore: true,
|
|
112
|
-
driftFiles: []
|
|
132
|
+
driftFiles: [],
|
|
133
|
+
orphanedPolicyFiles: []
|
|
113
134
|
};
|
|
114
135
|
}
|
|
115
136
|
|
|
116
|
-
const
|
|
117
|
-
const expected = buildGeneratedArtifacts(coreContent);
|
|
137
|
+
const expected = buildGeneratedArtifacts();
|
|
118
138
|
const driftFiles = [];
|
|
119
139
|
|
|
120
140
|
for (const [relPath, expectedContent] of Object.entries(expected)) {
|
|
@@ -130,16 +150,26 @@ async function validateInstructionDrift(targetDir) {
|
|
|
130
150
|
}
|
|
131
151
|
}
|
|
132
152
|
|
|
153
|
+
// Detect orphaned policy files that must not exist
|
|
154
|
+
const orphanedPolicyFiles = [];
|
|
155
|
+
for (const relPath of KNOWN_ORPHAN_PATHS) {
|
|
156
|
+
if (await fs.pathExists(path.join(targetDir, relPath))) {
|
|
157
|
+
orphanedPolicyFiles.push(relPath);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
133
161
|
return {
|
|
134
|
-
ok: driftFiles.length === 0,
|
|
162
|
+
ok: driftFiles.length === 0 && orphanedPolicyFiles.length === 0,
|
|
135
163
|
missingCore: false,
|
|
136
|
-
driftFiles
|
|
164
|
+
driftFiles,
|
|
165
|
+
orphanedPolicyFiles
|
|
137
166
|
};
|
|
138
167
|
}
|
|
139
168
|
|
|
140
169
|
module.exports = {
|
|
141
170
|
CORE_SOURCE_REL_PATH,
|
|
142
171
|
GENERATED_INSTRUCTION_PATHS,
|
|
172
|
+
KNOWN_ORPHAN_PATHS,
|
|
143
173
|
writeGeneratedInstructions,
|
|
144
174
|
validateInstructionDrift
|
|
145
175
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agents-templated",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
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": {
|
package/templates/.cursorrules
CHANGED
|
@@ -1,70 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
## Core Principles
|
|
11
|
-
- **Security-first development**: Always validate inputs, authenticate users, implement appropriate rate limiting
|
|
12
|
-
- **Type safety**: Use strong typing systems available in chosen language/framework
|
|
13
|
-
- **Performance optimization**: Monitor resource usage, implement caching, optimize assets
|
|
14
|
-
- **Testing strategy**: Comprehensive testing at unit, integration, and E2E levels
|
|
15
|
-
- **Accessibility**: WCAG 2.1 AA compliance for all user-facing interfaces
|
|
16
|
-
- **Documentation**: Keep project documentation updated and comprehensive
|
|
17
|
-
|
|
18
|
-
## Architecture Principles
|
|
19
|
-
- **Technology-agnostic**: This template adapts to your chosen stack
|
|
20
|
-
- **Security patterns**: Input validation, authentication, authorization, rate limiting
|
|
21
|
-
- **Performance patterns**: Caching, lazy loading, bundle optimization
|
|
22
|
-
- **Testing patterns**: Unit (80%), Integration (15%), E2E (5%) coverage target
|
|
23
|
-
- **Feature-oriented structure**: Group by domain/feature, not just technical layer
|
|
24
|
-
|
|
25
|
-
## Security Requirements (CRITICAL)
|
|
26
|
-
- **Input validation**: All user inputs MUST be validated with appropriate schema validation
|
|
27
|
-
- **Authentication**: Implement secure authentication flows with session management
|
|
28
|
-
- **Rate limiting**: Public endpoints MUST have rate limiting protection
|
|
29
|
-
- **Authorization**: Role-based access control with proper middleware
|
|
30
|
-
- **Error handling**: Never expose sensitive data in error responses
|
|
31
|
-
- **Database access**: Use ORM/ODM patterns, avoid raw queries unless performance-critical
|
|
32
|
-
|
|
33
|
-
## Code Quality Standards
|
|
34
|
-
- **Type Safety**: Use strict typing, avoid loose type usage
|
|
35
|
-
- **Performance**: Monitor bundle/binary size, implement lazy loading patterns
|
|
36
|
-
- **Accessibility**: WCAG 2.1 AA compliance for user-facing components
|
|
37
|
-
- **Testing**: All business logic and user flows must have appropriate tests
|
|
38
|
-
- **Documentation**: Keep README, agent-docs/ARCHITECTURE.md, and AGENTS.md updated
|
|
39
|
-
|
|
40
|
-
## Technology Stack Adaptation
|
|
41
|
-
Choose your stack and apply these patterns consistently:
|
|
42
|
-
|
|
43
|
-
### Frontend Options
|
|
44
|
-
- **React/Next.js/Vue/Svelte**: Component-based with proper state management
|
|
45
|
-
- **Angular**: Component + service architecture with TypeScript
|
|
46
|
-
- **Traditional**: Server-side rendering with progressive enhancement
|
|
47
|
-
|
|
48
|
-
### Backend Options
|
|
49
|
-
- **Node.js**: Express, Fastify, or framework API routes
|
|
50
|
-
- **Python**: Django, FastAPI, Flask with proper ORM patterns
|
|
51
|
-
- **Other**: Adapt patterns to your chosen backend technology
|
|
52
|
-
|
|
53
|
-
### Database Options
|
|
54
|
-
- **SQL**: PostgreSQL, MySQL with ORM (Prisma, TypeORM, SQLAlchemy)
|
|
55
|
-
- **NoSQL**: MongoDB, DynamoDB with ODM patterns
|
|
56
|
-
- **Cloud**: Supabase, Firebase, managed database services
|
|
57
|
-
|
|
58
|
-
## Agent Delegation (See AGENTS.md for details)
|
|
59
|
-
- **UI/Design work** → FrontendAgent
|
|
60
|
-
- **API/Business logic** → BackendAgent
|
|
61
|
-
- **Database/Schema** → DatabaseAgent
|
|
62
|
-
- **Testing implementation** → TestAgent
|
|
63
|
-
- **Security reviews** → SecurityAgent
|
|
64
|
-
- **Code quality** → ReviewerAgent
|
|
65
|
-
|
|
66
|
-
## Usage Instructions
|
|
67
|
-
1. Choose your technology stack
|
|
68
|
-
2. Adapt the patterns in agents/rules/*.mdc to your chosen technologies
|
|
69
|
-
3. Update this .cursorrules file with stack-specific details
|
|
70
|
-
4. Begin development following the established patterns
|
|
1
|
+
<!-- GENERATED FILE - DO NOT EDIT DIRECTLY -->
|
|
2
|
+
<!-- Source of truth: instructions/source/core.md -->
|
|
3
|
+
<!-- Tool profile: cursor-compat -->
|
|
4
|
+
# Cursor Rules
|
|
5
|
+
|
|
6
|
+
Primary policy source: `instructions/source/core.md`.
|
|
7
|
+
Load policy only from the canonical source file above.
|
|
8
|
+
Do not duplicate, summarize, or inline rules in this file.
|
|
9
|
+
If this file and the canonical source conflict, the canonical source wins.
|
|
@@ -1,64 +1,9 @@
|
|
|
1
|
+
<!-- GENERATED FILE - DO NOT EDIT DIRECTLY -->
|
|
2
|
+
<!-- Source of truth: instructions/source/core.md -->
|
|
3
|
+
<!-- Tool profile: copilot-compat -->
|
|
1
4
|
# GitHub Copilot Instructions
|
|
2
5
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
- **AI Guide**: See `AGENTS.md` for comprehensive instructions
|
|
8
|
-
- **Architecture**: See `agent-docs/ARCHITECTURE.md` for project guidelines
|
|
9
|
-
- **Custom Skills**: See `agents/skills/` directory for domain-specific extensions
|
|
10
|
-
- **Detailed Rules**: See `agents/rules/*.mdc` files
|
|
11
|
-
|
|
12
|
-
## Always Apply
|
|
13
|
-
|
|
14
|
-
1. **Security-first**: Validate inputs, authenticate endpoints, rate limit public APIs
|
|
15
|
-
- Reference: `agents/rules/security.mdc`
|
|
16
|
-
|
|
17
|
-
2. **Testing**: Unit (80%), Integration (15%), E2E (5%) coverage
|
|
18
|
-
- Reference: `agents/rules/testing.mdc`
|
|
19
|
-
|
|
20
|
-
3. **Type Safety**: Strong typing with runtime validation at boundaries
|
|
21
|
-
- Reference: `agents/rules/core.mdc`
|
|
22
|
-
|
|
23
|
-
## Agent Delegation
|
|
24
|
-
|
|
25
|
-
When implementing features, follow agent patterns from `AGENTS.MD`:
|
|
26
|
-
- **UI/Design** → FrontendAgent patterns (`agents/rules/frontend.mdc`)
|
|
27
|
-
- **API/Logic** → BackendAgent patterns (`agents/rules/security.mdc`)
|
|
28
|
-
- **Database** → DatabaseAgent patterns (`agents/rules/database.mdc`)
|
|
29
|
-
- **Testing** → TestAgent patterns (`agents/rules/testing.mdc`)
|
|
30
|
-
- **Security** → SecurityAgent patterns (`agents/rules/security.mdc`)
|
|
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
|
-
|
|
40
|
-
## Critical Rules
|
|
41
|
-
|
|
42
|
-
- Validate ALL user inputs with schema validation
|
|
43
|
-
- Authenticate and authorize protected endpoints
|
|
44
|
-
- Rate limit public endpoints
|
|
45
|
-
- Write tests for all business logic
|
|
46
|
-
- Ensure WCAG 2.1 AA accessibility compliance
|
|
47
|
-
- Use ORM/ODM patterns, avoid raw queries
|
|
48
|
-
- Never expose sensitive data in errors/logs
|
|
49
|
-
|
|
50
|
-
## Reference Files
|
|
51
|
-
|
|
52
|
-
- `AGENTS.MD` - Primary AI assistant guide
|
|
53
|
-
- `agent-docs/ARCHITECTURE.md` - Architecture and technology stack guidance
|
|
54
|
-
- `agents/commands/` - Deterministic slash command contracts
|
|
55
|
-
- `agents/rules/core.mdc` - Core principles
|
|
56
|
-
- `agents/rules/security.mdc` - Security patterns (CRITICAL)
|
|
57
|
-
- `agents/rules/testing.mdc` - Testing strategy (CRITICAL)
|
|
58
|
-
- `agents/rules/frontend.mdc` - Frontend patterns
|
|
59
|
-
- `agents/rules/database.mdc` - Database patterns
|
|
60
|
-
- `agents/rules/style.mdc` - Code style guidelines
|
|
61
|
-
|
|
62
|
-
---
|
|
63
|
-
|
|
64
|
-
**Note**: This is technology-agnostic. Adapt patterns to your chosen stack while maintaining security and quality standards.
|
|
6
|
+
Primary policy source: `instructions/source/core.md`.
|
|
7
|
+
Load policy only from the canonical source file above.
|
|
8
|
+
Do not duplicate, summarize, or inline rules in this file.
|
|
9
|
+
If this file and the canonical source conflict, the canonical source wins.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<!-- GENERATED FILE - DO NOT EDIT DIRECTLY -->
|
|
2
|
+
<!-- Source of truth: instructions/source/core.md -->
|
|
3
|
+
<!-- Tool profile: generic-compat -->
|
|
4
|
+
# AGENTS Instructions
|
|
5
|
+
|
|
6
|
+
Primary policy source: `instructions/source/core.md`.
|
|
7
|
+
Load policy only from the canonical source file above.
|
|
8
|
+
Do not duplicate, summarize, or inline rules in this file.
|
|
9
|
+
If this file and the canonical source conflict, the canonical source wins.
|
package/templates/CLAUDE.md
CHANGED
|
@@ -1,65 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
- **Detailed Rules**: See `agents/rules/*.mdc` files
|
|
11
|
-
|
|
12
|
-
## Always Apply
|
|
13
|
-
|
|
14
|
-
1. **Security-first**: Validate inputs, authenticate endpoints, rate limit public APIs
|
|
15
|
-
- Reference: `agents/rules/security.mdc`
|
|
16
|
-
|
|
17
|
-
2. **Testing**: Unit (80%), Integration (15%), E2E (5%) coverage
|
|
18
|
-
- Reference: `agents/rules/testing.mdc`
|
|
19
|
-
|
|
20
|
-
3. **Type Safety**: Strong typing with runtime validation at boundaries
|
|
21
|
-
- Reference: `agents/rules/core.mdc`
|
|
22
|
-
|
|
23
|
-
## Agent Delegation
|
|
24
|
-
|
|
25
|
-
When implementing features, reference `AGENTS.MD`:
|
|
26
|
-
- **UI/Design** → FrontendAgent patterns (`agents/rules/frontend.mdc`)
|
|
27
|
-
- **API/Logic** → BackendAgent patterns (`agents/rules/security.mdc`)
|
|
28
|
-
- **Database** → DatabaseAgent patterns (`agents/rules/database.mdc`)
|
|
29
|
-
- **Testing** → TestAgent patterns (`agents/rules/testing.mdc`)
|
|
30
|
-
- **Security** → SecurityAgent patterns (`agents/rules/security.mdc`)
|
|
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
|
-
|
|
40
|
-
## Critical Rules
|
|
41
|
-
|
|
42
|
-
- Validate ALL user inputs with schema validation
|
|
43
|
-
- Authenticate and authorize protected endpoints
|
|
44
|
-
- Rate limit public endpoints
|
|
45
|
-
- Write tests for all business logic
|
|
46
|
-
- Ensure WCAG 2.1 AA accessibility compliance
|
|
47
|
-
- Use ORM/ODM patterns, avoid raw queries
|
|
48
|
-
- Never expose sensitive data in errors/logs
|
|
49
|
-
|
|
50
|
-
## Reference Files
|
|
51
|
-
|
|
52
|
-
- `AGENTS.MD` - Primary AI assistant guide
|
|
53
|
-
- `agent-docs/ARCHITECTURE.md` - Architecture and technology stack guidance
|
|
54
|
-
- `AGENTS.MD` - AI assistant guide and patterns
|
|
55
|
-
- `agents/commands/` - Deterministic slash command contracts
|
|
56
|
-
- `agents/rules/core.mdc` - Core principles
|
|
57
|
-
- `agents/rules/security.mdc` - Security patterns (CRITICAL)
|
|
58
|
-
- `agents/rules/testing.mdc` - Testing strategy (CRITICAL)
|
|
59
|
-
- `agents/rules/frontend.mdc` - Frontend patterns
|
|
60
|
-
- `agents/rules/database.mdc` - Database patterns
|
|
61
|
-
- `agents/rules/style.mdc` - Code style guidelines
|
|
62
|
-
|
|
63
|
-
---
|
|
64
|
-
|
|
65
|
-
**Note**: This is technology-agnostic. Adapt patterns to your chosen stack while maintaining security and quality standards.
|
|
1
|
+
<!-- GENERATED FILE - DO NOT EDIT DIRECTLY -->
|
|
2
|
+
<!-- Source of truth: instructions/source/core.md -->
|
|
3
|
+
<!-- Tool profile: claude-compat -->
|
|
4
|
+
# Claude Instructions
|
|
5
|
+
|
|
6
|
+
Primary policy source: `instructions/source/core.md`.
|
|
7
|
+
Load policy only from the canonical source file above.
|
|
8
|
+
Do not duplicate, summarize, or inline rules in this file.
|
|
9
|
+
If this file and the canonical source conflict, the canonical source wins.
|