Skip to content

AI Prompt: Forma3D.Connect — Phase 5u: File Naming Convention

Purpose: This prompt instructs an AI to standardize file naming conventions across the codebase
Estimated Effort: 2-4 hours
Prerequisites: Phase 5t completed (Dead Code)
Output: Consistent kebab-case file naming throughout
Status: 🟡 PENDING


🎯 Mission

You are implementing Phase 5u: File Naming Convention — addressing TD-019 (Inconsistent File Naming) from the technical debt register.

Why This Matters:

Inconsistent file naming causes:

  1. Cognitive Load: Developers must remember which convention each file uses
  2. Import Errors: Case sensitivity issues on different OS
  3. Git Conflicts: Renaming files creates merge issues
  4. Search Difficulty: Inconsistent patterns harder to glob

📋 Context: Technical Debt Item

TD-019: Inconsistent File Naming

Attribute Value
Type Code Debt
Priority Low
Interest Rate Low
Principal (Effort) 2-4 hours

🛠️ Implementation

Phase 1: Audit Current Naming (30 minutes)

# Find non-kebab-case files
find apps libs -name "*.ts" -o -name "*.tsx" | grep -v node_modules | \
  xargs -I {} basename {} | sort -u | grep -E '[A-Z]'

Phase 2: Define Convention (15 minutes)

Standard: kebab-case for all files

Type Example
Component order-list.component.tsx
Service orders.service.ts
Controller orders.controller.ts
Test orders.service.spec.ts
Interface order.interface.ts
Enum order-status.enum.ts

Phase 3: Rename Files (2 hours)

Use git mv to preserve history:

git mv OrderList.tsx order-list.tsx

Update all imports after renaming.

Phase 4: Add ESLint Rule (30 minutes)

{
  "rules": {
    "filenames/match-regex": ["error", "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"]
  }
}

✅ Validation Checklist

  • All files follow kebab-case
  • Imports updated after renames
  • ESLint rule added for enforcement
  • pnpm nx build passes
  • Git history preserved

END OF PROMPT


This prompt resolves TD-019 from the technical debt register.