Skip to content

AI Prompt: Forma3D.Connect — Phase 5m: Unused Component Cleanup

Purpose: This prompt instructs an AI to identify and remove unused components from the codebase
Estimated Effort: 1-2 hours
Prerequisites: Phase 5l completed (ESLint Test Setup)
Output: Removal of unused nx-welcome component and any other dead components
Status: 🟡 PENDING


🎯 Mission

You are continuing development of Forma3D.Connect, building on the Phase 5l foundation. Your task is to implement Phase 5m: Unused Component Cleanup — specifically addressing TD-011 (Unused nx-welcome Component) from the technical debt register.

Why This Matters:

Unused components in the codebase cause:

  1. Confusion: Developers may try to use or maintain dead code
  2. Bundle Bloat: Unused code may be included in builds
  3. Maintenance Overhead: Dead code still needs to pass linting
  4. Search Noise: Searches return irrelevant results

Phase 5m delivers:

  • Removal of unused nx-welcome component
  • Audit of all components for usage
  • Clean component directory structure

📋 Context: Technical Debt Item

TD-011: Unused nx-welcome Component

Attribute Value
Type Code Debt
Priority Low
Location apps/web/src/app/nx-welcome.tsx
Interest Rate Low
Principal (Effort) 1-2 hours

Current Problem

Default Nx welcome component still exists but is likely unused after the application was built out.


🛠️ Implementation Phases

Phase 1: Audit Component Usage (30 minutes)

Priority: Critical | Impact: High | Dependencies: None

1. Check nx-welcome Usage

Search for any imports or references to the component:

# Search for imports
rg "nx-welcome" apps/web/src --type tsx --type ts

# Search for component usage in JSX
rg "<NxWelcome" apps/web/src

# Check if exported
rg "NxWelcome" apps/web/src

2. Verify Component Is Unused

Check apps/web/src/app/app.tsx and any route files:

// If nx-welcome is not imported or rendered, it's safe to remove
import { NxWelcome } from './nx-welcome'; // <- Look for this

3. Audit All Components

Run a comprehensive audit to find other potentially unused components:

# List all component files
find apps/web/src/components -name "*.tsx" | while read file; do
  component=$(basename "$file" .tsx)
  count=$(rg -c "$component" apps/web/src --type tsx --type ts 2>/dev/null | wc -l)
  echo "$file: $count references"
done

Phase 2: Remove Unused Components (30 minutes)

Priority: High | Impact: Low | Dependencies: Phase 1

1. Remove nx-welcome

# Remove the file
rm apps/web/src/app/nx-welcome.tsx

2. Update Any Index Files

If nx-welcome was exported from an index file:

// apps/web/src/app/index.ts
// Remove: export * from './nx-welcome';

3. Remove Unused Styles (if any)

# Check for associated styles
ls apps/web/src/app/ | grep -i welcome

Phase 3: Verify Build and Tests (30 minutes)

Priority: High | Impact: High | Dependencies: Phase 2

1. Run Build

pnpm nx build web

2. Run Tests

pnpm nx test web

3. Run Lint

pnpm nx lint web

Phase 4: Document Decision (15 minutes)

Priority: Low | Impact: Low | Dependencies: Phase 3

If component was intentionally kept for reference, document why. Otherwise, update the tech debt register.


📁 Files to Delete

apps/web/src/app/nx-welcome.tsx
apps/web/src/app/nx-welcome.module.css (if exists)
apps/web/src/app/nx-welcome.spec.tsx (if exists)

Files to Modify

apps/web/src/app/index.ts (if exports nx-welcome)
docs/04-development/techdebt/technical-debt-register.md

✅ Validation Checklist

  • Confirmed nx-welcome is not used anywhere
  • Removed nx-welcome.tsx and related files
  • Updated any barrel exports
  • pnpm nx build web passes
  • pnpm nx test web passes
  • pnpm nx lint web passes
  • No other unused components identified

Final Verification

# Build passes
pnpm nx build web

# Tests pass
pnpm nx test web

# Lint passes
pnpm nx lint web

# Component file is gone
ls apps/web/src/app/nx-welcome.tsx 2>&1 | grep "No such file"

📝 Tech Debt Register Update

After completion, update docs/04-development/techdebt/technical-debt-register.md:

### ~~TD-011: Unused nx-welcome Component~~ ✅ RESOLVED

**Type:** Code Debt  
**Status:****Resolved in Phase 5m**  
**Resolution Date:** 2026-XX-XX

#### Resolution

Removed the default Nx welcome component that was unused in the application:

**Files Deleted:**
- `apps/web/src/app/nx-welcome.tsx`

#### Verification
- Confirmed no imports or references existed
- Build and tests pass after removal

END OF PROMPT


This prompt resolves TD-011 from the technical debt register by removing the unused nx-welcome component.