agents-templated 2.2.5 → 2.2.7

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 (39) hide show
  1. package/README.md +27 -21
  2. package/bin/cli.js +12 -10
  3. package/lib/instructions.js +3 -3
  4. package/lib/layout.js +2 -2
  5. package/package.json +1 -1
  6. package/templates/.claude/rules/{ai-integration.mdc → ai-integration.md} +0 -6
  7. package/templates/.claude/rules/{core.mdc → core.md} +0 -7
  8. package/templates/.claude/rules/{database.mdc → database.md} +0 -7
  9. package/templates/.claude/rules/{frontend.mdc → frontend.md} +0 -7
  10. package/templates/.claude/rules/{guardrails.mdc → guardrails.md} +0 -8
  11. package/templates/.claude/rules/{hardening.mdc → hardening.md} +0 -6
  12. package/templates/.claude/rules/{intent-routing.mdc → intent-routing.md} +0 -5
  13. package/templates/.claude/rules/lessons-learned.md +44 -0
  14. package/templates/.claude/rules/{planning.mdc → planning.md} +0 -6
  15. package/templates/.claude/rules/{security.mdc → security.md} +0 -8
  16. package/templates/.claude/rules/{style.mdc → style.md} +0 -6
  17. package/templates/.claude/rules/{system-workflow.mdc → system-workflow.md} +0 -6
  18. package/templates/.claude/rules/{testing.mdc → testing.md} +0 -8
  19. package/templates/.claude/rules/{workflows.mdc → workflows.md} +0 -5
  20. package/templates/CLAUDE.md +32 -24
  21. package/templates/README.md +17 -14
  22. package/templates/agent-docs/ARCHITECTURE.md +2 -2
  23. package/templates/agent-docs/README.md +2 -2
  24. package/templates/agents/rules/{ai-integration.mdc → ai-integration.md} +0 -8
  25. package/templates/agents/rules/{core.mdc → core.md} +0 -7
  26. package/templates/agents/rules/{database.mdc → database.md} +1 -9
  27. package/templates/agents/rules/{frontend.mdc → frontend.md} +1 -9
  28. package/templates/agents/rules/{guardrails.mdc → guardrails.md} +1 -9
  29. package/templates/agents/rules/{hardening.mdc → hardening.md} +0 -8
  30. package/templates/agents/rules/{intent-routing.mdc → intent-routing.md} +0 -8
  31. package/templates/agents/rules/lessons-learned.md +44 -0
  32. package/templates/agents/rules/{planning.mdc → planning.md} +0 -8
  33. package/templates/agents/rules/{security.mdc → security.md} +1 -9
  34. package/templates/agents/rules/{style.mdc → style.md} +1 -9
  35. package/templates/agents/rules/{system-workflow.mdc → system-workflow.md} +0 -8
  36. package/templates/agents/rules/{testing.mdc → testing.md} +1 -9
  37. package/templates/agents/rules/{workflows.mdc → workflows.md} +0 -8
  38. package/templates/agents/skills/README.md +3 -0
  39. package/templates/agents/skills/error-patterns/SKILL.md +70 -0
package/README.md CHANGED
@@ -28,12 +28,14 @@ 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/`
38
40
  - Release and audit contracts now require hardening evidence when risk profile requires it
39
41
 
@@ -143,29 +145,33 @@ your-project/
143
145
  │ └── README.md # Human-readable setup guide
144
146
 
145
147
  ├── .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
148
+ │ ├── instructions/ # Compatibility pointer directory
159
149
  │ ├── skills/
160
150
  │ │ ├── find-skills/ # Skill discovery helper
161
151
  │ │ ├── feature-delivery/ # Scoped feature delivery workflow
162
152
  │ │ ├── bug-triage/ # Reproduction-first defect workflow
153
+ │ │ ├── error-patterns/ # Persistent error-debugging memory workflow
163
154
  │ │ ├── app-hardening/ # Hardening and release-evidence workflow
164
155
  │ │ ├── ui-ux-pro-max/ # Advanced UI/UX design implementation skill
165
156
  │ │ ├── README.md # Guide for creating custom skills
166
157
  │ │ └── [your-custom-skills]/ # Your project-specific skills
167
158
  │ └── copilot-instructions.md # Compatibility shim for Copilot
168
159
 
160
+ ├── .claude/
161
+ │ ├── rules/ # Canonical rules source
162
+ │ │ ├── core.md
163
+ │ │ ├── security.md
164
+ │ │ ├── testing.md
165
+ │ │ ├── frontend.md
166
+ │ │ ├── database.md
167
+ │ │ ├── style.md
168
+ │ │ ├── workflows.md
169
+ │ │ ├── intent-routing.md
170
+ │ │ ├── system-workflow.md
171
+ │ │ ├── hardening.md
172
+ │ │ └── lessons-learned.md
173
+ │ └── agents/ # Optional subagents
174
+
169
175
  ├── agents/ # 🤖 Deterministic command contracts
170
176
  │ └── commands/
171
177
  │ │ ├── SCHEMA.md # Global slash-command response schema
@@ -299,8 +305,8 @@ Skills define *how to execute specific tasks*, complementing rules that define *
299
305
  - **[AGENTS.MD](AGENTS.MD)** – AI assistant guide
300
306
  - **[agent-docs/ARCHITECTURE.md](agent-docs/ARCHITECTURE.md)** – Project architecture & tech stack guidance
301
307
  - **[.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
+ - **[.claude/rules/security.md](.claude/rules/security.md)** – Security patterns (CRITICAL)
309
+ - **[.claude/rules/testing.md](.claude/rules/testing.md)** – Testing strategy
304
310
 
305
311
  ### 5. Start Building
306
312
 
@@ -326,7 +332,7 @@ Your AI will follow the enterprise patterns automatically!
326
332
  ✅ Sanitize outputs to prevent injection attacks
327
333
  ✅ Never expose sensitive data in error messages or logs
328
334
 
329
- **Reference**: [.github/instructions/rules/security.mdc](.github/instructions/rules/security.mdc)
335
+ **Reference**: [.claude/rules/security.md](.claude/rules/security.md)
330
336
 
331
337
  ### Testing Strategy
332
338
 
@@ -334,7 +340,7 @@ Your AI will follow the enterprise patterns automatically!
334
340
  - **15% Integration Tests** – API endpoints, database operations
335
341
  - **5% E2E Tests** – Critical user journeys
336
342
 
337
- **Reference**: [.github/instructions/rules/testing.mdc](.github/instructions/rules/testing.mdc)
343
+ **Reference**: [.claude/rules/testing.md](.claude/rules/testing.md)
338
344
 
339
345
  ### Agent-Based Architecture
340
346
 
@@ -421,7 +427,7 @@ await agentsTemplated.install('./my-project', {
421
427
 
422
428
  When contributing to this template:
423
429
  1. Maintain technology-agnostic patterns
424
- 2. Update relevant rule files in `.github/instructions/rules/`
430
+ 2. Update relevant rule files in `.claude/rules/`
425
431
  3. Keep documentation synchronized with code changes
426
432
  4. Follow security and testing patterns
427
433
  5. Ensure AI assistant configurations remain compatible
package/bin/cli.js CHANGED
@@ -122,7 +122,7 @@ program
122
122
  choices: [
123
123
  { name: 'All components', value: 'all' },
124
124
  { name: 'Documentation files (agent-docs/)', value: 'docs' },
125
- { name: 'Agent rules (.claude/rules/*.mdc)', value: 'rules' },
125
+ { name: 'Agent rules (.claude/rules/*.md)', value: 'rules' },
126
126
  { name: 'Skills (.github/skills/*)', value: 'skills' },
127
127
  { name: 'AI Agent instructions (Cursor, Copilot, Claude, Generic AGENTS)', value: 'github' },
128
128
  { name: 'Agent subagents (.claude/agents/*.md)', value: 'subagents' }
@@ -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/*.mdc for your tech stack'));
386
+ console.log(chalk.white(' 4. Customize agents/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.mdc'));
389
+ console.log(chalk.white(' • Review agents/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'));
@@ -403,7 +403,7 @@ program
403
403
  .action(() => {
404
404
  console.log(chalk.blue.bold('\nAvailable Components:\n'));
405
405
  console.log(chalk.yellow('docs') + ' - Documentation files (agent-docs/ directory)');
406
- console.log(chalk.yellow('rules') + ' - Agent rules (.claude/rules/*.mdc)');
406
+ console.log(chalk.yellow('rules') + ' - Agent rules (.claude/rules/*.md)');
407
407
  console.log(chalk.yellow('skills') + ' - Agent skills (.github/skills/*)');
408
408
  console.log(chalk.yellow('github') + ' - AI Agent instructions (Cursor, Copilot, Claude, Generic AGENTS)');
409
409
  console.log(chalk.yellow('subagents') + ' - Agent subagents (.claude/agents/*.md)');
@@ -455,7 +455,7 @@ program
455
455
  }
456
456
 
457
457
  // Check agent rules
458
- const ruleFiles = ['core.mdc', 'security.mdc', 'testing.mdc', 'frontend.mdc', 'database.mdc', 'style.mdc'];
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));
@@ -829,11 +829,13 @@ program
829
829
  const checkFiles = [
830
830
  { targetFile: CANONICAL_INSTRUCTION_FILE, templateFile: CANONICAL_INSTRUCTION_FILE, component: 'root' },
831
831
  { targetFile: 'agent-docs/ARCHITECTURE.md', templateFile: 'agent-docs/ARCHITECTURE.md', component: 'docs' },
832
- { targetFile: `${LAYOUT.canonical.rulesDir}/security.mdc`, templateFile: 'agents/rules/security.mdc', component: 'rules' },
833
- { targetFile: `${LAYOUT.canonical.rulesDir}/testing.mdc`, templateFile: 'agents/rules/testing.mdc', component: 'rules' },
834
- { targetFile: `${LAYOUT.canonical.rulesDir}/core.mdc`, templateFile: 'agents/rules/core.mdc', component: 'rules' },
832
+ { targetFile: `${LAYOUT.canonical.rulesDir}/security.md`, templateFile: 'agents/rules/security.md', component: 'rules' },
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' },
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' },
838
+ { targetFile: `${LAYOUT.canonical.skillsDir}/error-patterns/SKILL.md`, templateFile: 'agents/skills/error-patterns/SKILL.md', component: 'skills' },
837
839
  { targetFile: `${LAYOUT.canonical.skillsDir}/ui-ux-pro-max/SKILL.md`, templateFile: 'agents/skills/ui-ux-pro-max/SKILL.md', component: 'skills' }
838
840
  ];
839
841
 
@@ -989,7 +991,7 @@ program
989
991
  console.log(chalk.blue('\n📚 Quick Tips:\n'));
990
992
  console.log(chalk.white(' • Run "agents-templated validate" to check setup'));
991
993
  console.log(chalk.white(' • Run "agents-templated wizard" for guided setup'));
992
- console.log(chalk.white(' • Review agents/rules/security.mdc for security patterns\n'));
994
+ console.log(chalk.white(' • Review agents/rules/security.md for security patterns\n'));
993
995
 
994
996
  } catch (error) {
995
997
  console.error(chalk.red('Error:'), error.message);
@@ -1015,7 +1017,7 @@ program
1015
1017
 
1016
1018
  program
1017
1019
  .command('new-rule <name>')
1018
- .description('Scaffold a new rule in agents/rules/<name>.mdc')
1020
+ .description('Scaffold a new rule in agents/rules/<name>.md')
1019
1021
  .action(async (name) => {
1020
1022
  try {
1021
1023
  const targetDir = process.cwd();
@@ -137,10 +137,10 @@ async function scaffoldSkill(targetDir, skillName) {
137
137
 
138
138
  async function scaffoldRule(targetDir, ruleName) {
139
139
  const rulesDir = path.join(targetDir, 'agents', 'rules');
140
- const ruleFile = path.join(rulesDir, `${ruleName}.mdc`);
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}.mdc`);
143
+ throw new Error(`Rule already exists: agents/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}.mdc`;
171
+ return `agents/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.5",
3
+ "version": "2.2.7",
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": {
@@ -5,12 +5,6 @@ version: "1.0.0"
5
5
  tags: ["ai", "llm", "openai", "anthropic", "rag", "prompt-engineering", "safety"]
6
6
  alwaysApply: false
7
7
  globs: ["**/*llm*", "**/*openai*", "**/*anthropic*", "**/*langchain*", "**/*rag*", "**/ai/**"]
8
- triggers:
9
- - "Integrating OpenAI, Claude, or other LLM APIs"
10
- - "Building RAG (Retrieval-Augmented Generation) pipeline"
11
- - "Engineering prompts or prompt chains"
12
- - "Implementing LLM-powered features"
13
- - "Evaluating LLM outputs or quality"
14
8
  ---
15
9
 
16
10
  ## Purpose
@@ -6,13 +6,6 @@ version: "3.0.0"
6
6
  tags: ["architecture", "core", "enterprise", "technology-agnostic"]
7
7
  globs:
8
8
  - "*"
9
- triggers:
10
- - "Designing application architecture"
11
- - "Setting up new project or module"
12
- - "Defining type systems and validation"
13
- - "Organizing code structure"
14
- - "Improving code quality standards"
15
- - "Making testing or performance decisions"
16
9
  ---
17
10
 
18
11
  ## Developer Identity
@@ -7,13 +7,6 @@ tags: ["database", "backend", "data", "orm", "schema"]
7
7
  globs:
8
8
  - "src/models/**/*"
9
9
  - "src/data/**/*"
10
- triggers:
11
- - "Designing database schema or tables"
12
- - "Creating/updating ORM models or queries"
13
- - "Running database migrations"
14
- - "Optimizing slow queries"
15
- - "Selecting database technology"
16
- - "Implementing access control for data"
17
10
  ---
18
11
 
19
12
  # Database and Data Layer Guidelines
@@ -8,13 +8,6 @@ globs:
8
8
  - "src/**/*"
9
9
  - "components/**/*"
10
10
  - "public/**/*"
11
- triggers:
12
- - "Building user interfaces or components"
13
- - "Designing responsive layouts"
14
- - "Creating forms and validations"
15
- - "Implementing accessibility features"
16
- - "Working on user-facing features"
17
- - "Optimizing performance for frontend"
18
11
  ---
19
12
 
20
13
  # Frontend Development Guidelines
@@ -4,14 +4,6 @@ title: "AI Agent Guardrails"
4
4
  description: "Enforce hard behavioral limits on all agents. Apply when any destructive, irreversible, or dangerous action is requested"
5
5
  version: "1.0.0"
6
6
  tags: ["guardrails", "safety", "scope", "reversibility", "agent-behavior"]
7
- triggers:
8
- - "User requests file/folder/branch deletion"
9
- - "Force pushing or hard-resetting git history"
10
- - "Deploying to production"
11
- - "Dropping database tables"
12
- - "Disabling tests to make build pass"
13
- - "Bypassing security controls"
14
- - "Any action that cannot be easily undone"
15
7
  ---
16
8
 
17
9
  ## Purpose
@@ -3,12 +3,6 @@ title: "Application Hardening & Obfuscation"
3
3
  description: "Apply when building client-distributed apps, protecting IP logic, or preparing releases with anti-tamper requirements"
4
4
  version: "1.0.0"
5
5
  tags: ["hardening", "obfuscation", "anti-tamper", "security"]
6
- triggers:
7
- - "Building mobile or desktop app for distribution"
8
- - "Protecting high-value or proprietary logic"
9
- - "Increasing tamper detection or anti-hooking"
10
- - "Preparing production release with security concerns"
11
- - "Performance and integrity validation needed"
12
6
  ---
13
7
 
14
8
  ## Purpose
@@ -3,11 +3,6 @@ title: "Intent Routing & Command Selection"
3
3
  description: "Apply when determining which rule or workflow applies to the user's request. Ensures correct execution pathway"
4
4
  version: "1.0.0"
5
5
  tags: ["routing", "deterministic", "workflow", "commands"]
6
- triggers:
7
- - "Ambiguous or multi-intent user request"
8
- - "Need to route to correct rule or workflow"
9
- - "Destructive action requested"
10
- - "Scope expansion detected"
11
6
  ---
12
7
 
13
8
  ## Purpose
@@ -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. -->
@@ -4,12 +4,6 @@ description: "Apply when implementing features, designing systems, or making arc
4
4
  version: "1.0.0"
5
5
  tags: ["planning", "workflow", "documentation", "prompts"]
6
6
  alwaysApply: true
7
- triggers:
8
- - "User asks to implement a new feature"
9
- - "Making design or architecture decisions"
10
- - "Planning a significant refactor"
11
- - "Fixing bugs that require investigation"
12
- - "Discussion produces decisions affecting architecture"
13
7
  ---
14
8
 
15
9
  ## Purpose
@@ -4,14 +4,6 @@ description: "Apply when implementing authentication, authorization, API validat
4
4
  alwaysApply: true
5
5
  version: "3.0.0"
6
6
  tags: ["security", "auth", "validation", "secrets", "owasp"]
7
- triggers:
8
- - "User adds login/authentication to project"
9
- - "Building API endpoints or handling user input"
10
- - "Storing passwords, tokens, or sensitive data"
11
- - "Validating form inputs or API requests"
12
- - "Protecting against injection, XSS, CSRF"
13
- - "Adding authorization/permissions to endpoints"
14
- - "Integrating third-party APIs or external services"
15
7
  ---
16
8
 
17
9
  # Security Rules & Best Practices
@@ -6,12 +6,6 @@ version: "3.0.0"
6
6
  tags: ["style", "formatting", "naming", "quality"]
7
7
  globs:
8
8
  - "**/*"
9
- triggers:
10
- - "Writing or reviewing code"
11
- - "Setting up code formatting rules"
12
- - "Naming variables, functions, or files"
13
- - "Organizing module structure"
14
- - "Refactoring or improving readability"
15
9
  ---
16
10
 
17
11
  # Code Style and Standards
@@ -3,12 +3,6 @@ title: "System Workflow Orchestration"
3
3
  description: "Apply when planning work phases, defining acceptance criteria, or establishing delivery gates and rollback strategies"
4
4
  version: "1.0.0"
5
5
  tags: ["workflow", "gates", "delivery", "governance"]
6
- triggers:
7
- - "Starting a new feature or major change"
8
- - "Planning implementation phases"
9
- - "Defining acceptance criteria"
10
- - "Establishing rollback procedures"
11
- - "Preparing for release or deployment"
12
6
  ---
13
7
 
14
8
  ## Purpose
@@ -3,14 +3,6 @@ title: "Testing Guidelines & Best Practices"
3
3
  description: "Apply when adding tests, verifying coverage, or validating quality before deployment. Always required for business logic and critical flows"
4
4
  version: "3.0.0"
5
5
  tags: ["testing", "quality", "coverage", "e2e", "a11y"]
6
- triggers:
7
- - "User requests tests for business logic"
8
- - "Implementing a new feature"
9
- - "Fixing a bug"
10
- - "Need to verify API endpoints work"
11
- - "Checking application behavior"
12
- - "Hardening release artifacts"
13
- - "CI/CD validation needed before deployment"
14
6
  ---
15
7
 
16
8
  # Testing Guidelines & Best Practices
@@ -6,11 +6,6 @@ version: "1.0.0"
6
6
  tags: ["workflow", "quality", "validation", "commit"]
7
7
  globs:
8
8
  - "**/*"
9
- triggers:
10
- - "User asks about workflow or pre-commit steps"
11
- - "Need to keep project validated"
12
- - "Running quality gates before merge"
13
- - "Post-hardening verification needed"
14
9
  ---
15
10
 
16
11
  # Development Workflow Guidelines
@@ -11,19 +11,20 @@ All policy, routing, and skill governance lives here — edit this file directly
11
11
 
12
12
  | Module | File | Apply when... |
13
13
  |--------|------|---------------|
14
- | Security | `.claude/rules/security.mdc` | Implementing authentication, validating inputs, protecting against injection attacks |
15
- | Testing | `.claude/rules/testing.mdc` | Adding tests, verifying coverage, validating quality before deployment |
16
- | Core | `.claude/rules/core.mdc` | Designing architecture, setting up projects, defining type systems |
17
- | Database | `.claude/rules/database.mdc` | Designing schema, building data access layers, optimizing queries |
18
- | Frontend | `.claude/rules/frontend.mdc` | Building UI components, designing pages, creating forms, implementing accessibility |
19
- | Style | `.claude/rules/style.mdc` | Organizing code, naming variables, improving clarity and maintainability |
20
- | System Workflow | `.claude/rules/system-workflow.mdc` | Planning delivery phases, defining acceptance criteria, establishing rollback |
21
- | Workflows | `.claude/rules/workflows.mdc` | Optimizing development process, running pre-commit checks, keeping project healthy |
22
- | Hardening | `.claude/rules/hardening.mdc` | Building distributed apps, protecting IP logic, preparing production releases |
23
- | Intent Routing | `.claude/rules/intent-routing.mdc` | Determining which rule applies, routing to correct execution pathway |
24
- | Planning | `.claude/rules/planning.mdc` | Implementing features, designing systems, making architectural decisions |
25
- | AI Integration | `.claude/rules/ai-integration.mdc` | Integrating LLMs, RAG pipelines, prompt engineering, AI-powered features |
26
- | Guardrails | `.claude/rules/guardrails.mdc` | Any destructive/irreversible action, scope expansion, dangerous requests |
14
+ | Security | `.claude/rules/security.md` | Implementing authentication, validating inputs, protecting against injection attacks |
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 |
17
+ | Core | `.claude/rules/core.md` | Designing architecture, setting up projects, defining type systems |
18
+ | Database | `.claude/rules/database.md` | Designing schema, building data access layers, optimizing queries |
19
+ | Frontend | `.claude/rules/frontend.md` | Building UI components, designing pages, creating forms, implementing accessibility |
20
+ | Style | `.claude/rules/style.md` | Organizing code, naming variables, improving clarity and maintainability |
21
+ | System Workflow | `.claude/rules/system-workflow.md` | Planning delivery phases, defining acceptance criteria, establishing rollback |
22
+ | Workflows | `.claude/rules/workflows.md` | Optimizing development process, running pre-commit checks, keeping project healthy |
23
+ | Hardening | `.claude/rules/hardening.md` | Building distributed apps, protecting IP logic, preparing production releases |
24
+ | Intent Routing | `.claude/rules/intent-routing.md` | Determining which rule applies, routing to correct execution pathway |
25
+ | Planning | `.claude/rules/planning.md` | Implementing features, designing systems, making architectural decisions |
26
+ | AI Integration | `.claude/rules/ai-integration.md` | Integrating LLMs, RAG pipelines, prompt engineering, AI-powered features |
27
+ | Guardrails | `.claude/rules/guardrails.md` | Any destructive/irreversible action, scope expansion, dangerous requests |
27
28
 
28
29
  ### Skill modules (`.github/skills/`)
29
30
 
@@ -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 |
@@ -59,40 +61,45 @@ Subagents are bounded agents with limited tool access. They inherit all policy f
59
61
 
60
62
  ## Always Enforce
61
63
 
62
- 1. **Security-first (non-overrideable)** — `.claude/rules/security.mdc`
64
+ 1. **Security-first (non-overrideable)** — `.claude/rules/security.md`
63
65
  - Validate all external inputs at boundaries.
64
66
  - Require authentication and role-based authorization for protected operations.
65
67
  - Rate-limit public APIs.
66
68
  - Never expose secrets, credentials, or PII in logs/errors/responses.
67
69
 
68
- 2. **Testing discipline (non-overrideable)** — `.claude/rules/testing.mdc`
70
+ 2. **Testing discipline (non-overrideable)** — `.claude/rules/testing.md`
69
71
  - Coverage mix target: Unit 80% / Integration 15% / E2E 5%.
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.mdc`
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.mdc`
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.mdc`
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.mdc`
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.mdc`, `.claude/rules/workflows.mdc`
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.mdc`
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.mdc`
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.mdc`
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.
@@ -106,7 +113,7 @@ All items above are policy-level requirements; skills and command modes cannot w
106
113
 
107
114
  ## Intent Routing
108
115
 
109
- Use `.github/instructions/rules/intent-routing.mdc` and route each task to one primary module:
116
+ Use `.claude/rules/intent-routing.md` and route each task to one primary module:
110
117
 
111
118
  - UI/Design → Frontend
112
119
  - API/Logic → Security + Core
@@ -115,6 +122,7 @@ Use `.github/instructions/rules/intent-routing.mdc` and route each task to one p
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,25 @@ 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
139
132
  │ │ ├── README.md # Guide for creating custom skills
140
133
  │ │ └── [your-custom-skills]/ # Your project-specific skills
141
134
  │ └── copilot-instructions.md # Compatibility shim for Copilot
142
135
 
136
+ ├── .claude/
137
+ │ ├── rules/ # Canonical rules source
138
+ │ │ ├── core.md
139
+ │ │ ├── security.md
140
+ │ │ ├── testing.md
141
+ │ │ ├── frontend.md
142
+ │ │ ├── database.md
143
+ │ │ ├── style.md
144
+ │ │ └── lessons-learned.md
145
+
143
146
  ├── agents/ # 🤖 Deterministic command contracts
144
147
  │ └── commands/
145
148
  │ │ ├── SCHEMA.md # Global slash-command response schema
@@ -273,8 +276,8 @@ Skills define *how to execute specific tasks*, complementing rules that define *
273
276
  - **[AGENTS.MD](AGENTS.MD)** – AI assistant guide
274
277
  - **[agent-docs/ARCHITECTURE.md](agent-docs/ARCHITECTURE.md)** – Project architecture & tech stack guidance
275
278
  - **[.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
279
+ - **[.claude/rules/security.md](.claude/rules/security.md)** – Security patterns (CRITICAL)
280
+ - **[.claude/rules/testing.md](.claude/rules/testing.md)** – Testing strategy
278
281
 
279
282
  ### 5. Start Building
280
283
 
@@ -300,7 +303,7 @@ Your AI will follow the enterprise patterns automatically!
300
303
  ✅ Sanitize outputs to prevent injection attacks
301
304
  ✅ Never expose sensitive data in error messages or logs
302
305
 
303
- **Reference**: [.github/instructions/rules/security.mdc](.github/instructions/rules/security.mdc)
306
+ **Reference**: [.claude/rules/security.md](.claude/rules/security.md)
304
307
 
305
308
  ### Testing Strategy
306
309
 
@@ -308,7 +311,7 @@ Your AI will follow the enterprise patterns automatically!
308
311
  - **15% Integration Tests** – API endpoints, database operations
309
312
  - **5% E2E Tests** – Critical user journeys
310
313
 
311
- **Reference**: [.github/instructions/rules/testing.mdc](.github/instructions/rules/testing.mdc)
314
+ **Reference**: [.claude/rules/testing.md](.claude/rules/testing.md)
312
315
 
313
316
  ### Agent-Based Architecture
314
317
 
@@ -395,7 +398,7 @@ await agentsTemplated.install('./my-project', {
395
398
 
396
399
  When contributing to this template:
397
400
  1. Maintain technology-agnostic patterns
398
- 2. Update relevant rule files in `.github/instructions/rules/`
401
+ 2. Update relevant rule files in `.claude/rules/`
399
402
  3. Keep documentation synchronized with code changes
400
403
  4. Follow security and testing patterns
401
404
  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
@@ -5,14 +5,6 @@ version: "3.0.0"
5
5
  tags: ["ai", "llm", "openai", "anthropic", "rag", "prompt-engineering", "safety"]
6
6
  alwaysApply: false
7
7
  globs: ["**/*llm*", "**/*openai*", "**/*anthropic*", "**/*langchain*", "**/*rag*", "**/ai/**"]
8
- triggers:
9
- - "Integrating OpenAI or other LLM API"
10
- - "Building RAG pipeline or semantic search"
11
- - "Implementing prompt template or engineering"
12
- - "Adding AI-powered feature to application"
13
- - "Evaluating LLM responses or quality"
14
- - "Optimizing LLM API costs"
15
- - "Implementing AI moderation or safety controls"
16
8
  ---
17
9
 
18
10
  ## Purpose
@@ -6,13 +6,6 @@ version: "3.0.0"
6
6
  tags: ["architecture", "core", "enterprise", "technology-agnostic"]
7
7
  globs:
8
8
  - "*"
9
- triggers:
10
- - "Designing application architecture"
11
- - "Setting up new project or module"
12
- - "Defining type systems and validation"
13
- - "Organizing code structure"
14
- - "Improving code quality standards"
15
- - "Making testing or performance decisions"
16
9
  ---
17
10
 
18
11
  ## Developer Identity
@@ -1,4 +1,4 @@
1
- ---
1
+ ---
2
2
  title: "Database and Data Layer Guidelines"
3
3
  description: "Apply when designing schema, building data access layers, optimizing queries, or managing database operations"
4
4
  alwaysApply: true
@@ -7,14 +7,6 @@ tags: ["database", "backend", "data", "orm", "schema"]
7
7
  globs:
8
8
  - "src/models/**/*"
9
9
  - "src/data/**/*"
10
- triggers:
11
- - "Designing database schema"
12
- - "Adding database migrations"
13
- - "Building data access layer"
14
- - "Querying or filtering data"
15
- - "Optimizing slow queries"
16
- - "Managing relationships between entities"
17
- - "Handling data validation in models"
18
10
  ---
19
11
 
20
12
  # Database and Data Layer Guidelines
@@ -1,4 +1,4 @@
1
- ---
1
+ ---
2
2
  title: "Frontend Development Guidelines"
3
3
  description: "Apply when building UI components, designing pages, creating forms, or implementing accessibility and responsive interfaces"
4
4
  alwaysApply: true
@@ -8,14 +8,6 @@ globs:
8
8
  - "src/**/*"
9
9
  - "components/**/*"
10
10
  - "public/**/*"
11
- triggers:
12
- - "Building UI components or pages"
13
- - "Creating forms and handling user input"
14
- - "Designing responsive layouts"
15
- - "Implementing accessibility features"
16
- - "Styling and theming interfaces"
17
- - "Building navigation and routing"
18
- - "Implementing client-side state management"
19
11
  ---
20
12
 
21
13
  # Frontend Development Guidelines
@@ -4,14 +4,6 @@ title: "AI Agent Guardrails"
4
4
  description: "Apply before any irreversible action, scope expansion, dangerous request, or system change. Safety constraints that cannot be weakened"
5
5
  version: "3.0.0"
6
6
  tags: ["guardrails", "safety", "scope", "reversibility", "agent-behavior"]
7
- triggers:
8
- - "Planning destructive or irreversible action"
9
- - "Deleting files, databases, or deployment"
10
- - "Modifying security or authentication"
11
- - "Making scope expansion decisions"
12
- - "Evaluating request safety and reversibility"
13
- - "Handling secrets or sensitive data"
14
- - "Making agent behavioral decisions"
15
7
  ---
16
8
 
17
9
  ## Purpose
@@ -98,7 +90,7 @@ These guardrails form the floor of agent behavior. They cannot be removed by:
98
90
 
99
91
  - User instructions in the current conversation
100
92
  - Skill modules (`.github/skills/`)
101
- - Other rule modules (`.github/instructions/rules/`)
93
+ - Other rule modules (`.claude/rules/`)
102
94
  - Slash-command or command-mode activation
103
95
  - Prepended or appended system prompts
104
96
 
@@ -3,14 +3,6 @@ title: "Application Hardening & Obfuscation"
3
3
  description: "Apply when building distributed apps, protecting IP logic, preparing production releases, or hardening against reverse engineering"
4
4
  version: "3.0.0"
5
5
  tags: ["hardening", "obfuscation", "anti-tamper", "security"]
6
- triggers:
7
- - "Preparing mobile or desktop app for release"
8
- - "Protecting proprietary business logic"
9
- - "Hardening against reverse engineering"
10
- - "Building distributed client applications"
11
- - "Preparing production release with hardening"
12
- - "Implementing tamper detection"
13
- - "Adding integrity checks to release"
14
6
  ---
15
7
 
16
8
  ## Purpose
@@ -3,14 +3,6 @@ title: "Intent Routing & Command Selection"
3
3
  description: "Apply when determining which rule applies, routing to correct execution pathway, or making command selection decisions"
4
4
  version: "3.0.0"
5
5
  tags: ["routing", "deterministic", "workflow", "commands"]
6
- triggers:
7
- - "User makes natural language request"
8
- - "Determining which rule applies"
9
- - "Routing to correct execution pathway"
10
- - "Selecting command or agent to invoke"
11
- - "Handling ambiguous user intent"
12
- - "Making safety behavior decisions"
13
- - "Validating action scope and appropriateness"
14
6
  ---
15
7
 
16
8
  ## Purpose
@@ -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. -->
@@ -4,14 +4,6 @@ description: "Apply when implementing features, designing systems, discussing ar
4
4
  version: "3.0.0"
5
5
  tags: ["planning", "workflow", "documentation", "prompts"]
6
6
  alwaysApply: true
7
- triggers:
8
- - "User requests a new feature"
9
- - "Planning implementation approach"
10
- - "Discussing architectural changes"
11
- - "Breaking down user stories"
12
- - "Creating acceptance criteria"
13
- - "Designing database schema"
14
- - "Planning deployment phases"
15
7
  ---
16
8
 
17
9
  ## Purpose
@@ -1,17 +1,9 @@
1
- ---
1
+ ---
2
2
  title: "Security Rules & Best Practices"
3
3
  description: "Apply when implementing authentication, authorization, API validation, secrets management, or protecting against OWASP Top 10 vulnerabilities"
4
4
  alwaysApply: true
5
5
  version: "3.0.0"
6
6
  tags: ["security", "auth", "validation", "secrets", "owasp"]
7
- triggers:
8
- - "User adds login/authentication to project"
9
- - "Building API endpoints or handling user input"
10
- - "Storing passwords, tokens, or sensitive data"
11
- - "Validating form inputs or API requests"
12
- - "Protecting against injection, XSS, CSRF"
13
- - "Adding authorization/permissions to endpoints"
14
- - "Integrating third-party APIs or external services"
15
7
  ---
16
8
 
17
9
  # Security Rules & Best Practices
@@ -1,4 +1,4 @@
1
- ---
1
+ ---
2
2
  title: "Code Style and Standards"
3
3
  description: "Apply when organizing code, naming variables/functions, improving clarity, formatting with consistency, and maintaining code quality"
4
4
  alwaysApply: true
@@ -6,14 +6,6 @@ version: "3.0.0"
6
6
  tags: ["style", "formatting", "naming", "quality"]
7
7
  globs:
8
8
  - "**/*"
9
- triggers:
10
- - "Writing new code or functions"
11
- - "Organizing code structure"
12
- - "Naming variables, functions, or classes"
13
- - "Formatting code for readability"
14
- - "Improving code documentation"
15
- - "Refactoring for clarity"
16
- - "Following project conventions"
17
9
  ---
18
10
 
19
11
  # Code Style and Standards
@@ -3,14 +3,6 @@ title: "System Workflow Orchestration"
3
3
  description: "Apply when planning delivery phases, defining acceptance criteria, establishing rollback procedures, or orchestrating multi-step workflows"
4
4
  version: "3.0.0"
5
5
  tags: ["workflow", "gates", "delivery", "governance"]
6
- triggers:
7
- - "Implementing feature with multiple phases"
8
- - "Defining deployment gates and approval"
9
- - "Planning rollback strategy"
10
- - "Creating acceptance criteria"
11
- - "Coordinating deployment across services"
12
- - "Planning database migration"
13
- - "Managing breaking API changes"
14
6
  ---
15
7
 
16
8
  ## Purpose
@@ -1,16 +1,8 @@
1
- ---
1
+ ---
2
2
  title: "Testing Guidelines & Best Practices"
3
3
  description: "Apply when adding tests, verifying coverage, or validating quality before deployment. Always required for business logic and critical flows"
4
4
  version: "3.0.0"
5
5
  tags: ["testing", "quality", "coverage", "e2e", "a11y"]
6
- triggers:
7
- - "User requests tests for business logic"
8
- - "Implementing a new feature"
9
- - "Fixing a bug"
10
- - "Need to verify API endpoints work"
11
- - "Checking application behavior"
12
- - "Hardening release artifacts"
13
- - "CI/CD validation needed before deployment"
14
6
  ---
15
7
 
16
8
  # Testing Guidelines & Best Practices
@@ -6,14 +6,6 @@ version: "3.0.0"
6
6
  tags: ["workflow", "quality", "validation", "commit"]
7
7
  globs:
8
8
  - "**/*"
9
- triggers:
10
- - "Running pre-commit hooks"
11
- - "Validating code quality gates"
12
- - "Setting up CI/CD pipeline"
13
- - "Checking code before commit"
14
- - "Running linting or formatting"
15
- - "Executing test suites automatically"
16
- - "Maintaining project health and standards"
17
9
  ---
18
10
 
19
11
  # Development Workflow Guidelines
@@ -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,6 +98,7 @@ 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.
100
103
 
101
104
  ## Using Skills in Your Project
@@ -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.`