agents-templated 2.2.6 → 2.2.8

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 CHANGED
@@ -28,13 +28,16 @@ Agents Templated scaffolds your project with:
28
28
  - Deterministic slash-command standard in `AGENTS.MD` and modular contracts in `agents/commands/`
29
29
  - Implicit natural-language routing support (`slash-command-auto`) for non-technical prompts
30
30
  - New workflow/routing/hardening rule set:
31
- - `.github/instructions/rules/intent-routing.mdc`
32
- - `.github/instructions/rules/system-workflow.mdc`
33
- - `.github/instructions/rules/hardening.mdc`
31
+ - `.claude/rules/intent-routing.md`
32
+ - `.claude/rules/system-workflow.md`
33
+ - `.claude/rules/hardening.md`
34
+ - `.claude/rules/lessons-learned.md`
34
35
  - New baseline skills:
35
36
  - `.github/skills/feature-delivery/`
36
37
  - `.github/skills/bug-triage/`
38
+ - `.github/skills/error-patterns/`
37
39
  - `.github/skills/app-hardening/`
40
+ - `.github/skills/shadcn-ui/`
38
41
  - Release and audit contracts now require hardening evidence when risk profile requires it
39
42
 
40
43
  ---
@@ -143,29 +146,34 @@ your-project/
143
146
  │ └── README.md # Human-readable setup guide
144
147
 
145
148
  ├── .github/
146
- │ ├── instructions/ # Generated compatibility wrappers + rules
147
- │ │ ├── AGENTS.md
148
- │ │ └── rules/
149
- │ │ ├── core.mdc # Core development principles
150
- │ │ ├── security.mdc # Security patterns (CRITICAL)
151
- │ │ ├── testing.mdc # Testing strategy
152
- │ │ ├── frontend.mdc # Frontend patterns
153
- │ │ ├── database.mdc # Database patterns
154
- │ │ ├── style.mdc # Code style guidelines
155
- │ │ ├── workflows.mdc # Workflow and quality gates
156
- │ │ ├── intent-routing.mdc # Intent-to-command routing policy
157
- │ │ ├── system-workflow.mdc # End-to-end delivery lifecycle gates
158
- │ │ └── hardening.mdc # Hardening and obfuscation guidance
149
+ │ ├── instructions/ # Compatibility pointer directory
159
150
  │ ├── skills/
160
151
  │ │ ├── find-skills/ # Skill discovery helper
161
152
  │ │ ├── feature-delivery/ # Scoped feature delivery workflow
162
153
  │ │ ├── bug-triage/ # Reproduction-first defect workflow
154
+ │ │ ├── error-patterns/ # Persistent error-debugging memory workflow
163
155
  │ │ ├── app-hardening/ # Hardening and release-evidence workflow
164
156
  │ │ ├── ui-ux-pro-max/ # Advanced UI/UX design implementation skill
157
+ │ │ ├── shadcn-ui/ # shadcn/ui setup and component patterns
165
158
  │ │ ├── README.md # Guide for creating custom skills
166
159
  │ │ └── [your-custom-skills]/ # Your project-specific skills
167
160
  │ └── copilot-instructions.md # Compatibility shim for Copilot
168
161
 
162
+ ├── .claude/
163
+ │ ├── rules/ # Canonical rules source
164
+ │ │ ├── core.md
165
+ │ │ ├── security.md
166
+ │ │ ├── testing.md
167
+ │ │ ├── frontend.md
168
+ │ │ ├── database.md
169
+ │ │ ├── style.md
170
+ │ │ ├── workflows.md
171
+ │ │ ├── intent-routing.md
172
+ │ │ ├── system-workflow.md
173
+ │ │ ├── hardening.md
174
+ │ │ └── lessons-learned.md
175
+ │ └── agents/ # Optional subagents
176
+
169
177
  ├── agents/ # 🤖 Deterministic command contracts
170
178
  │ └── commands/
171
179
  │ │ ├── SCHEMA.md # Global slash-command response schema
@@ -299,8 +307,8 @@ Skills define *how to execute specific tasks*, complementing rules that define *
299
307
  - **[AGENTS.MD](AGENTS.MD)** – AI assistant guide
300
308
  - **[agent-docs/ARCHITECTURE.md](agent-docs/ARCHITECTURE.md)** – Project architecture & tech stack guidance
301
309
  - **[.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
310
+ - **[.claude/rules/security.md](.claude/rules/security.md)** – Security patterns (CRITICAL)
311
+ - **[.claude/rules/testing.md](.claude/rules/testing.md)** – Testing strategy
304
312
 
305
313
  ### 5. Start Building
306
314
 
@@ -326,7 +334,7 @@ Your AI will follow the enterprise patterns automatically!
326
334
  ✅ Sanitize outputs to prevent injection attacks
327
335
  ✅ Never expose sensitive data in error messages or logs
328
336
 
329
- **Reference**: [.github/instructions/rules/security.mdc](.github/instructions/rules/security.mdc)
337
+ **Reference**: [.claude/rules/security.md](.claude/rules/security.md)
330
338
 
331
339
  ### Testing Strategy
332
340
 
@@ -334,7 +342,7 @@ Your AI will follow the enterprise patterns automatically!
334
342
  - **15% Integration Tests** – API endpoints, database operations
335
343
  - **5% E2E Tests** – Critical user journeys
336
344
 
337
- **Reference**: [.github/instructions/rules/testing.mdc](.github/instructions/rules/testing.mdc)
345
+ **Reference**: [.claude/rules/testing.md](.claude/rules/testing.md)
338
346
 
339
347
  ### Agent-Based Architecture
340
348
 
@@ -421,7 +429,7 @@ await agentsTemplated.install('./my-project', {
421
429
 
422
430
  When contributing to this template:
423
431
  1. Maintain technology-agnostic patterns
424
- 2. Update relevant rule files in `.github/instructions/rules/`
432
+ 2. Update relevant rule files in `.claude/rules/`
425
433
  3. Keep documentation synchronized with code changes
426
434
  4. Follow security and testing patterns
427
435
  5. Ensure AI assistant configurations remain compatible
package/bin/cli.js CHANGED
@@ -383,10 +383,10 @@ program
383
383
  console.log(chalk.white(' 1. Review CLAUDE.md (canonical AI policy — edit this directly)'));
384
384
  console.log(chalk.white(' 2. Review agent-docs/ARCHITECTURE.md for project guidelines'));
385
385
  console.log(chalk.white(' 3. AGENTS.MD and .github/copilot-instructions.md are thin pointers to CLAUDE.md'));
386
- console.log(chalk.white(' 4. Customize agents/rules/*.md for your tech stack'));
386
+ console.log(chalk.white(' 4. Customize .claude/rules/*.md for your tech stack'));
387
387
 
388
388
  console.log(chalk.cyan('\n🔒 Security Reminder:\n'));
389
- console.log(chalk.white(' • Review agents/rules/security.md'));
389
+ console.log(chalk.white(' • Review .claude/rules/security.md'));
390
390
  console.log(chalk.white(' • Validate all inputs with schema validation'));
391
391
  console.log(chalk.white(' • Implement rate limiting on public endpoints'));
392
392
  console.log(chalk.white(' • Never expose sensitive data in errors\n'));
@@ -455,7 +455,7 @@ program
455
455
  }
456
456
 
457
457
  // Check agent rules
458
- const ruleFiles = ['core.md', 'security.md', 'testing.md', 'frontend.md', 'database.md', 'style.md'];
458
+ const ruleFiles = ['core.md', 'security.md', 'testing.md', 'lessons-learned.md', 'frontend.md', 'database.md', 'style.md'];
459
459
  const canonicalRulesDir = path.join(targetDir, LAYOUT.canonical.rulesDir);
460
460
  const legacyRulesDir = path.join(targetDir, LAYOUT.legacy.rulesDirs[0]);
461
461
  const rulesDir = path.join(targetDir, resolveRulesDir(targetDir));
@@ -831,10 +831,13 @@ program
831
831
  { targetFile: 'agent-docs/ARCHITECTURE.md', templateFile: 'agent-docs/ARCHITECTURE.md', component: 'docs' },
832
832
  { targetFile: `${LAYOUT.canonical.rulesDir}/security.md`, templateFile: 'agents/rules/security.md', component: 'rules' },
833
833
  { targetFile: `${LAYOUT.canonical.rulesDir}/testing.md`, templateFile: 'agents/rules/testing.md', component: 'rules' },
834
+ { targetFile: `${LAYOUT.canonical.rulesDir}/lessons-learned.md`, templateFile: 'agents/rules/lessons-learned.md', component: 'rules' },
834
835
  { targetFile: `${LAYOUT.canonical.rulesDir}/core.md`, templateFile: 'agents/rules/core.md', component: 'rules' },
835
836
  { targetFile: `${LAYOUT.canonical.skillsDir}/README.md`, templateFile: 'agents/skills/README.md', component: 'skills' },
836
837
  { targetFile: `${LAYOUT.canonical.skillsDir}/find-skills/SKILL.md`, templateFile: 'agents/skills/find-skills/SKILL.md', component: 'skills' },
837
- { targetFile: `${LAYOUT.canonical.skillsDir}/ui-ux-pro-max/SKILL.md`, templateFile: 'agents/skills/ui-ux-pro-max/SKILL.md', component: 'skills' }
838
+ { targetFile: `${LAYOUT.canonical.skillsDir}/error-patterns/SKILL.md`, templateFile: 'agents/skills/error-patterns/SKILL.md', component: 'skills' },
839
+ { targetFile: `${LAYOUT.canonical.skillsDir}/ui-ux-pro-max/SKILL.md`, templateFile: 'agents/skills/ui-ux-pro-max/SKILL.md', component: 'skills' },
840
+ { targetFile: `${LAYOUT.canonical.skillsDir}/shadcn-ui/SKILL.md`, templateFile: 'agents/skills/shadcn-ui/SKILL.md', component: 'skills' }
838
841
  ];
839
842
 
840
843
  for (const {targetFile, templateFile, component} of checkFiles) {
@@ -989,7 +992,7 @@ program
989
992
  console.log(chalk.blue('\n📚 Quick Tips:\n'));
990
993
  console.log(chalk.white(' • Run "agents-templated validate" to check setup'));
991
994
  console.log(chalk.white(' • Run "agents-templated wizard" for guided setup'));
992
- console.log(chalk.white(' • Review agents/rules/security.md for security patterns\n'));
995
+ console.log(chalk.white(' • Review .claude/rules/security.md for security patterns\n'));
993
996
 
994
997
  } catch (error) {
995
998
  console.error(chalk.red('Error:'), error.message);
@@ -999,7 +1002,7 @@ program
999
1002
 
1000
1003
  program
1001
1004
  .command('new-skill <name>')
1002
- .description('Scaffold a new skill in agents/skills/<name>/SKILL.md')
1005
+ .description('Scaffold a new skill in .github/skills/<name>/SKILL.md')
1003
1006
  .action(async (name) => {
1004
1007
  try {
1005
1008
  const targetDir = process.cwd();
@@ -1015,7 +1018,7 @@ program
1015
1018
 
1016
1019
  program
1017
1020
  .command('new-rule <name>')
1018
- .description('Scaffold a new rule in agents/rules/<name>.md')
1021
+ .description('Scaffold a new rule in .claude/rules/<name>.md')
1019
1022
  .action(async (name) => {
1020
1023
  try {
1021
1024
  const targetDir = process.cwd();
@@ -96,11 +96,11 @@ async function validateInstructionDrift(targetDir) {
96
96
  }
97
97
 
98
98
  async function scaffoldSkill(targetDir, skillName) {
99
- const skillDir = path.join(targetDir, 'agents', 'skills', skillName);
99
+ const skillDir = path.join(targetDir, '.github', 'skills', skillName);
100
100
  const skillFile = path.join(skillDir, 'SKILL.md');
101
101
 
102
102
  if (await fs.pathExists(skillFile)) {
103
- throw new Error(`Skill already exists: agents/skills/${skillName}/SKILL.md`);
103
+ throw new Error(`Skill already exists: .github/skills/${skillName}/SKILL.md`);
104
104
  }
105
105
 
106
106
  const title = skillName.split('-').map(w => w[0].toUpperCase() + w.slice(1)).join(' ');
@@ -132,15 +132,15 @@ async function scaffoldSkill(targetDir, skillName) {
132
132
 
133
133
  await fs.ensureDir(skillDir);
134
134
  await fs.writeFile(skillFile, content, 'utf8');
135
- return `agents/skills/${skillName}/SKILL.md`;
135
+ return `.github/skills/${skillName}/SKILL.md`;
136
136
  }
137
137
 
138
138
  async function scaffoldRule(targetDir, ruleName) {
139
- const rulesDir = path.join(targetDir, 'agents', 'rules');
139
+ const rulesDir = path.join(targetDir, '.claude', 'rules');
140
140
  const ruleFile = path.join(rulesDir, `${ruleName}.md`);
141
141
 
142
142
  if (await fs.pathExists(ruleFile)) {
143
- throw new Error(`Rule already exists: agents/rules/${ruleName}.md`);
143
+ throw new Error(`Rule already exists: .claude/rules/${ruleName}.md`);
144
144
  }
145
145
 
146
146
  const content = [
@@ -168,7 +168,7 @@ async function scaffoldRule(targetDir, ruleName) {
168
168
 
169
169
  await fs.ensureDir(rulesDir);
170
170
  await fs.writeFile(ruleFile, content, 'utf8');
171
- return `agents/rules/${ruleName}.md`;
171
+ return `.claude/rules/${ruleName}.md`;
172
172
  }
173
173
 
174
174
  async function scaffoldSubagent(targetDir, name) {
package/lib/layout.js CHANGED
@@ -9,11 +9,11 @@ const LAYOUT = {
9
9
  subagentsDir: '.claude/agents'
10
10
  },
11
11
  legacy: {
12
- rulesDirs: ['agents/rules', '.github/instructions/rules'],
12
+ rulesDirs: ['agents/rules'],
13
13
  skillsDirs: ['agents/skills']
14
14
  },
15
15
  compatible: {
16
- rulesDirs: ['.github/instructions'],
16
+ rulesDirs: [],
17
17
  skillsDirs: ['.claude/skills', '.agents/skills']
18
18
  }
19
19
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agents-templated",
3
- "version": "2.2.6",
3
+ "version": "2.2.8",
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": {
@@ -0,0 +1,44 @@
1
+ ---
2
+ alwaysApply: true
3
+ title: "Lessons Learned"
4
+ description: "Apply before debugging: check known error patterns first, then record every new resolved fix"
5
+ version: "1.0.0"
6
+ tags: ["debugging", "memory", "lessons", "error-patterns"]
7
+ ---
8
+
9
+ # Lessons Learned - Persistent Error Memory
10
+
11
+ ## Purpose
12
+
13
+ This rule is the agent's long-term memory for recurring errors and fixes.
14
+ Always check this rule before debugging. If a matching error exists, apply that known fix first.
15
+
16
+ ## Required Workflow
17
+
18
+ 1. Before debugging, check this file for matching symptoms.
19
+ 2. If a match is found, apply the known fix immediately.
20
+ 3. If no match is found, debug using the `error-patterns` skill checklist.
21
+ 4. After every successful fix, append a new lesson entry.
22
+
23
+ ## Lesson Entry Format
24
+
25
+ ```markdown
26
+ ### [CATEGORY] Short title of the error
27
+ - **Symptom**: What the error looked like (message, behavior)
28
+ - **Root Cause**: Why it happened
29
+ - **Fix**: Exact steps or code that resolved it
30
+ - **Avoid**: What NOT to do next time
31
+ - **Date**: YYYY-MM-DD
32
+ ```
33
+
34
+ Allowed categories: `[BUILD]` `[DB]` `[API/AUTH]` `[UI]` `[TYPE]` `[CONFIG]` `[OTHER]`
35
+
36
+ ## Enforcement
37
+
38
+ - This rule is non-overrideable.
39
+ - Lesson recording is mandatory after each resolved error.
40
+ - Do not remove existing lessons unless explicitly requested.
41
+
42
+ ## Known Lessons
43
+
44
+ <!-- New lessons are appended below this line. Do not remove this comment. -->
@@ -13,6 +13,7 @@ All policy, routing, and skill governance lives here — edit this file directly
13
13
  |--------|------|---------------|
14
14
  | Security | `.claude/rules/security.md` | Implementing authentication, validating inputs, protecting against injection attacks |
15
15
  | Testing | `.claude/rules/testing.md` | Adding tests, verifying coverage, validating quality before deployment |
16
+ | Lessons Learned | `.claude/rules/lessons-learned.md` | Debugging recurring errors and applying previously resolved fixes first |
16
17
  | Core | `.claude/rules/core.md` | Designing architecture, setting up projects, defining type systems |
17
18
  | Database | `.claude/rules/database.md` | Designing schema, building data access layers, optimizing queries |
18
19
  | Frontend | `.claude/rules/frontend.md` | Building UI components, designing pages, creating forms, implementing accessibility |
@@ -31,6 +32,7 @@ All policy, routing, and skill governance lives here — edit this file directly
31
32
  |-------|------|------------------|
32
33
  | app-hardening | `.github/skills/app-hardening/SKILL.md` | Hardening, anti-tamper, integrity controls |
33
34
  | bug-triage | `.github/skills/bug-triage/SKILL.md` | Something is broken, failing, or crashing |
35
+ | error-patterns | `.github/skills/error-patterns/SKILL.md` | Debugging with persistent lessons memory and automatic fix recording |
34
36
  | feature-delivery | `.github/skills/feature-delivery/SKILL.md` | Build/add/implement feature work |
35
37
  | find-skills | `.github/skills/find-skills/SKILL.md` | User asks to discover a skill |
36
38
  | ui-ux-pro-max | `.github/skills/ui-ux-pro-max/SKILL.md` | UI, layout, design, visual work |
@@ -70,29 +72,34 @@ Subagents are bounded agents with limited tool access. They inherit all policy f
70
72
  - Business logic must have tests; critical flows need integration coverage.
71
73
  - Never disable/remove tests to pass builds.
72
74
 
73
- 3. **Type safety and runtime boundaries** — `.claude/rules/core.md`
75
+ 3. **Lessons Learned (non-overrideable)** — `.claude/rules/lessons-learned.md`
76
+ - On any error, read lessons first; if matched, apply the known fix immediately.
77
+ - If new, debug via the `error-patterns` skill checklist and record the resolved fix.
78
+ - Keep lessons structured and persistent so future sessions reuse known solutions.
79
+
80
+ 4. **Type safety and runtime boundaries** — `.claude/rules/core.md`
74
81
  - Strong internal typing, runtime validation at boundaries, explicit error models.
75
82
 
76
- 4. **Database integrity** — `.claude/rules/database.md`
83
+ 5. **Database integrity** — `.claude/rules/database.md`
77
84
  - Prefer ORM/ODM, justify raw queries, enforce DB constraints, prevent N+1, reversible migrations.
78
85
 
79
- 5. **Frontend standards** — `.claude/rules/frontend.md`
86
+ 6. **Frontend standards** — `.claude/rules/frontend.md`
80
87
  - WCAG 2.1 AA, responsive defaults, clear loading/error states, no unsafe client trust.
81
88
 
82
- 6. **Style and consistency** — `.claude/rules/style.md`
89
+ 7. **Style and consistency** — `.claude/rules/style.md`
83
90
  - Consistent naming, small composable modules, explicit contracts, no magic values.
84
91
 
85
- 7. **Workflow discipline** — `.claude/rules/system-workflow.md`, `.claude/rules/workflows.md`
92
+ 8. **Workflow discipline** — `.claude/rules/system-workflow.md`, `.claude/rules/workflows.md`
86
93
  - Feature branches only, no direct main edits, deterministic PR structure, review gates.
87
94
 
88
- 8. **Hardening mode** — `.claude/rules/hardening.md`
95
+ 9. **Hardening mode** — `.claude/rules/hardening.md`
89
96
  - In hardening/audit contexts: assume hostile input, threat-model, validate config safety, strict rate limits, dependency audit.
90
97
 
91
- 9. **Planning discipline** — `.claude/rules/planning.md`
98
+ 10. **Planning discipline** — `.claude/rules/planning.md`
92
99
  - Every feature discussion or implementation produces a `.github/prompts/` plan file.
93
100
  - Plans are updated as work progresses, not discarded.
94
101
 
95
- 10. **Guardrails (non-overrideable)** — `.claude/rules/guardrails.md`
102
+ 11. **Guardrails (non-overrideable)** — `.claude/rules/guardrails.md`
96
103
  - Require `CONFIRM-DESTRUCTIVE:<target>` token before any destructive/irreversible action.
97
104
  - Work only within the defined task scope; no silent expansion.
98
105
  - Classify every action by reversibility before executing.
@@ -115,6 +122,7 @@ Use `.claude/rules/intent-routing.md` and route each task to one primary module:
115
122
  - Refactor/Cleanup → Style
116
123
  - Audit/Production readiness → Hardening
117
124
  - Feature planning → Planning
125
+ - Debugging / recurring failures → Lessons Learned + error-patterns skill
118
126
  - LLM/AI work → AI Integration
119
127
  - Scope creep / dangerous action / agent behavioral safety → Guardrails
120
128
  - Multi-step orchestration / planning / code review → Subagents
@@ -124,22 +124,26 @@ your-project/
124
124
  │ └── README.md # Human-readable setup guide
125
125
 
126
126
  ├── .github/
127
- │ ├── instructions/ # Generated compatibility wrappers + rules
128
- │ │ ├── AGENTS.md
129
- │ │ └── rules/
130
- │ │ ├── core.mdc # Core development principles
131
- │ │ ├── security.mdc # Security patterns (CRITICAL)
132
- │ │ ├── testing.mdc # Testing strategy
133
- │ │ ├── frontend.mdc # Frontend patterns
134
- │ │ ├── database.mdc # Database patterns
135
- │ │ └── style.mdc # Code style guidelines
127
+ │ ├── instructions/ # Compatibility pointer directory
136
128
  │ ├── skills/
137
129
  │ │ ├── find-skills/ # Skill discovery helper
130
+ │ │ ├── error-patterns/ # Persistent error-debugging memory workflow
138
131
  │ │ ├── ui-ux-pro-max/ # Advanced UI/UX design implementation skill
132
+ │ │ ├── shadcn-ui/ # shadcn/ui setup and component patterns
139
133
  │ │ ├── README.md # Guide for creating custom skills
140
134
  │ │ └── [your-custom-skills]/ # Your project-specific skills
141
135
  │ └── copilot-instructions.md # Compatibility shim for Copilot
142
136
 
137
+ ├── .claude/
138
+ │ ├── rules/ # Canonical rules source
139
+ │ │ ├── core.md
140
+ │ │ ├── security.md
141
+ │ │ ├── testing.md
142
+ │ │ ├── frontend.md
143
+ │ │ ├── database.md
144
+ │ │ ├── style.md
145
+ │ │ └── lessons-learned.md
146
+
143
147
  ├── agents/ # 🤖 Deterministic command contracts
144
148
  │ └── commands/
145
149
  │ │ ├── SCHEMA.md # Global slash-command response schema
@@ -273,8 +277,8 @@ Skills define *how to execute specific tasks*, complementing rules that define *
273
277
  - **[AGENTS.MD](AGENTS.MD)** – AI assistant guide
274
278
  - **[agent-docs/ARCHITECTURE.md](agent-docs/ARCHITECTURE.md)** – Project architecture & tech stack guidance
275
279
  - **[.github/skills/README.md](.github/skills/README.md)** – Custom skills guide
276
- - **[.github/instructions/rules/security.mdc](.github/instructions/rules/security.mdc)** – Security patterns (CRITICAL)
277
- - **[.github/instructions/rules/testing.mdc](.github/instructions/rules/testing.mdc)** – Testing strategy
280
+ - **[.claude/rules/security.md](.claude/rules/security.md)** – Security patterns (CRITICAL)
281
+ - **[.claude/rules/testing.md](.claude/rules/testing.md)** – Testing strategy
278
282
 
279
283
  ### 5. Start Building
280
284
 
@@ -300,7 +304,7 @@ Your AI will follow the enterprise patterns automatically!
300
304
  ✅ Sanitize outputs to prevent injection attacks
301
305
  ✅ Never expose sensitive data in error messages or logs
302
306
 
303
- **Reference**: [.github/instructions/rules/security.mdc](.github/instructions/rules/security.mdc)
307
+ **Reference**: [.claude/rules/security.md](.claude/rules/security.md)
304
308
 
305
309
  ### Testing Strategy
306
310
 
@@ -308,7 +312,7 @@ Your AI will follow the enterprise patterns automatically!
308
312
  - **15% Integration Tests** – API endpoints, database operations
309
313
  - **5% E2E Tests** – Critical user journeys
310
314
 
311
- **Reference**: [.github/instructions/rules/testing.mdc](.github/instructions/rules/testing.mdc)
315
+ **Reference**: [.claude/rules/testing.md](.claude/rules/testing.md)
312
316
 
313
317
  ### Agent-Based Architecture
314
318
 
@@ -395,7 +399,7 @@ await agentsTemplated.install('./my-project', {
395
399
 
396
400
  When contributing to this template:
397
401
  1. Maintain technology-agnostic patterns
398
- 2. Update relevant rule files in `.github/instructions/rules/`
402
+ 2. Update relevant rule files in `.claude/rules/`
399
403
  3. Keep documentation synchronized with code changes
400
404
  4. Follow security and testing patterns
401
405
  5. Ensure AI assistant configurations remain compatible
@@ -5,7 +5,7 @@ These guidelines are for both humans and AI assistants working with any technolo
5
5
 
6
6
  - Canonical AI policy source lives in `CLAUDE.md`.
7
7
  - **Agent responsibilities** and MCP integration are documented in `AGENTS.MD`.
8
- - **Detailed implementation rules** live in `.github/instructions/rules/*.mdc` files.
8
+ - **Detailed implementation rules** live in `.claude/rules/*.md` files.
9
9
  - **Custom skills** for domain-specific tasks are organized in `.github/skills/` (see [Skills Guide](../.github/skills/README.md)).
10
10
 
11
11
  Read this file first to understand the architecture, then consult `AGENTS.MD` for agent delegation.
@@ -223,7 +223,7 @@ Review the options above and select technologies that fit your:
223
223
  - **Timeline** and development velocity requirements
224
224
 
225
225
  ### 2. Adapt the Template
226
- - Update `.github/instructions/rules/*.mdc` files with technology-specific patterns
226
+ - Update `.claude/rules/*.md` files with technology-specific patterns
227
227
  - Keep `.cursorrules`, `.github/copilot-instructions.md`, `AGENTS.MD`, and `CLAUDE.md` as minimal wrappers that point to `CLAUDE.md`
228
228
  - Update `CLAUDE.md` with stack-specific guidelines
229
229
  - Create appropriate configuration files for your chosen tools
@@ -9,7 +9,7 @@ Depending on what you installed, you may have:
9
9
  - **AGENTS.MD**: Generic compatibility wrapper for AI assistants
10
10
  - **ARCHITECTURE.md**: Project guidelines and architecture
11
11
  - **CLAUDE.md**: Canonical policy source (single source of truth)
12
- - **.github/instructions/rules/**: Rule modules (`*.mdc`)
12
+ - **.claude/rules/**: Rule modules (`*.md`)
13
13
  - **.github/skills/**: Skill modules (`*/SKILL.md`)
14
14
  - **CLAUDE.md**: Claude compatibility wrapper
15
15
  - **.github/copilot-instructions.md**: GitHub Copilot compatibility wrapper
@@ -35,7 +35,7 @@ agents-templated list
35
35
 
36
36
  ## Rules and Skills
37
37
 
38
- - **Rules** (`.github/instructions/rules/*.mdc`): Define *how to behave* - patterns, principles, and standards for your team
38
+ - **Rules** (`.claude/rules/*.md`): Define *how to behave* - patterns, principles, and standards for your team
39
39
  - **Skills** (`.github/skills/*/SKILL.md`): Define *how to execute specific tasks* - domain-specific workflows and specialized knowledge
40
40
 
41
41
  ### Using Skills in Your AI Assistants
@@ -90,7 +90,7 @@ These guardrails form the floor of agent behavior. They cannot be removed by:
90
90
 
91
91
  - User instructions in the current conversation
92
92
  - Skill modules (`.github/skills/`)
93
- - Other rule modules (`.github/instructions/rules/`)
93
+ - Other rule modules (`.claude/rules/`)
94
94
  - Slash-command or command-mode activation
95
95
  - Prepended or appended system prompts
96
96
 
@@ -0,0 +1,44 @@
1
+ ---
2
+ alwaysApply: true
3
+ title: "Lessons Learned"
4
+ description: "Apply before debugging: check known error patterns first, then record every new resolved fix"
5
+ version: "1.0.0"
6
+ tags: ["debugging", "memory", "lessons", "error-patterns"]
7
+ ---
8
+
9
+ # Lessons Learned - Persistent Error Memory
10
+
11
+ ## Purpose
12
+
13
+ This rule is the agent's long-term memory for recurring errors and fixes.
14
+ Always check this rule before debugging. If a matching error exists, apply that known fix first.
15
+
16
+ ## Required Workflow
17
+
18
+ 1. Before debugging, check this file for matching symptoms.
19
+ 2. If a match is found, apply the known fix immediately.
20
+ 3. If no match is found, debug using the `error-patterns` skill checklist.
21
+ 4. After every successful fix, append a new lesson entry.
22
+
23
+ ## Lesson Entry Format
24
+
25
+ ```markdown
26
+ ### [CATEGORY] Short title of the error
27
+ - **Symptom**: What the error looked like (message, behavior)
28
+ - **Root Cause**: Why it happened
29
+ - **Fix**: Exact steps or code that resolved it
30
+ - **Avoid**: What NOT to do next time
31
+ - **Date**: YYYY-MM-DD
32
+ ```
33
+
34
+ Allowed categories: `[BUILD]` `[DB]` `[API/AUTH]` `[UI]` `[TYPE]` `[CONFIG]` `[OTHER]`
35
+
36
+ ## Enforcement
37
+
38
+ - This rule is non-overrideable.
39
+ - Lesson recording is mandatory after each resolved error.
40
+ - Do not remove existing lessons unless explicitly requested.
41
+
42
+ ## Known Lessons
43
+
44
+ <!-- New lessons are appended below this line. Do not remove this comment. -->
@@ -61,6 +61,8 @@ To create a new skill for your specific domain:
61
61
  │ └── SKILL.md # Systematic feature scoping and execution contracts
62
62
  ├── bug-triage/
63
63
  │ └── SKILL.md # Reproduction-first debugging and regression workflows
64
+ ├── error-patterns/
65
+ │ └── SKILL.md # Persistent debugging memory and known-fix application
64
66
  ├── app-hardening/
65
67
  │ └── SKILL.md # Risk-based hardening and obfuscation guidance
66
68
  ├── ui-ux-pro-max/
@@ -96,7 +98,9 @@ Consider creating skills for:
96
98
 
97
99
  - `feature-delivery`: Use when user asks are broad and you need objective, scope, acceptance criteria, and validation plan.
98
100
  - `bug-triage`: Use for defects and regressions requiring reproducible evidence, root-cause isolation, and minimal safe patches.
101
+ - `error-patterns`: Use when errors repeat to apply known fixes from lessons-learned and automatically record new resolutions.
99
102
  - `app-hardening`: Use for high-risk/distributed runtimes to enforce hardening profile, obfuscation decisions, and release evidence.
103
+ - `shadcn-ui`: Use for shadcn/ui installation, component composition, form patterns, and theme customization.
100
104
 
101
105
  ## Using Skills in Your Project
102
106
 
@@ -0,0 +1,70 @@
1
+ ---
2
+ name: error-patterns
3
+ description: >
4
+ Activate this skill whenever something is broken, failing, erroring, or crashing, especially
5
+ for build errors, type errors, database/migration failures, API/auth issues, and UI bugs.
6
+ Also activate when the user says "fix this", "it's broken", "I'm getting an error", or
7
+ "this keeps happening".
8
+ ---
9
+
10
+ # Error Patterns
11
+
12
+ You are debugging with persistent memory. Every fix should be recorded so it does not need to be solved twice.
13
+
14
+ ## Step 1 - Check Lessons First (Always)
15
+
16
+ Before writing any fix, read `.claude/rules/lessons-learned.md`.
17
+
18
+ - Search for symptoms that match the current error.
19
+ - If a match is found, apply the known fix directly and state that the known fix was used.
20
+ - If no match is found, continue to Step 2.
21
+
22
+ ## Step 2 - Diagnose by Category
23
+
24
+ ### [BUILD] Build / Type Errors
25
+ - Read the full error trace, not just the first line.
26
+ - Check for version mismatches, missing imports, circular dependencies, and config issues.
27
+ - Verify lock file and dependency sync.
28
+
29
+ ### [DB] Database / Migration Errors
30
+ - Check whether the migration already ran.
31
+ - Verify DB URL and environment target.
32
+ - Check for schema drift between model and database.
33
+ - Avoid destructive migrations without a backup.
34
+
35
+ ### [API/AUTH] API / Auth Errors
36
+ - Check token expiry, missing headers, and wrong scopes.
37
+ - Verify environment variables for keys/secrets.
38
+ - Check CORS and middleware order.
39
+ - Log request/response safely (no secrets).
40
+
41
+ ### [UI] Frontend / UI Bugs
42
+ - Check hydration mismatches.
43
+ - Verify null/undefined guards and prop contracts.
44
+ - Check list keys and class conflicts.
45
+ - Confirm loading and error states are handled.
46
+
47
+ ## Step 3 - Apply the Fix
48
+
49
+ - Make the minimum safe change needed.
50
+ - Do not expand scope beyond the reported error.
51
+
52
+ ## Step 4 - Record the Lesson (Mandatory)
53
+
54
+ After every successful fix, append to `.claude/rules/lessons-learned.md` using:
55
+
56
+ ```markdown
57
+ ### [CATEGORY] Short title of the error
58
+ - **Symptom**: What the error looked like (message, behavior)
59
+ - **Root Cause**: Why it happened
60
+ - **Fix**: Exact steps or code that resolved it
61
+ - **Avoid**: What NOT to do next time
62
+ - **Date**: YYYY-MM-DD
63
+ ```
64
+
65
+ ## Step 5 - User Confirmation Message
66
+
67
+ After fixing and recording, respond with one of:
68
+
69
+ - `Fixed. I've saved this to lessons-learned so we won't have to solve it again.`
70
+ - `Found this in lessons-learned and applied the known fix.`