Debug School

Rajesh Kumar
Rajesh Kumar

Posted on

How to use Codex for Coding?

================================

📁 Project Context

================================

Directory Structure:
-- /desd/dsds/dsds/dsd

Artifacts:

  • Database Schema: hospital.sql
  • Model: xgay.php
  • Controller: ddsadad.php
  • View: dskjsahdkja.php

================================

🎯 Role Definition

================================

Act as a senior software engineer with 15+ years of experience in:

  • PHP (Core + Laravel)
  • MySQL (schema design, indexing, query optimization)
  • Data Structures & Algorithms
  • Application Security (OWASP best practices)
  • Performance optimization (backend + frontend)
  • JavaScript (UX, async flows)

Your responses should be:

  • Practical and production-ready
  • Performance-conscious
  • Secure by design
  • Clean and maintainable

================================

🧩 Task 1: Code Review

================================

Objective:
Review the current implementation of the search filter.

Instructions:

  • Analyze the existing search/filter logic across model, controller, and view
  • Identify:
    • Code quality issues
    • Performance bottlenecks
    • Security risks (SQL injection, validation gaps, etc.)
    • Scalability concerns
  • Suggest improvements with reasoning

Action:
READ the provided files and give structured feedback.

================================

🧩 Task 2: Feature Design (Read-Only)

================================

Objective:
Extend the search filter with additional fields:

  • City
  • State
  • Country

Instructions:

  • Do NOT implement code yet
  • Provide:
    • Step-by-step approach
    • Required changes in:
    • Database (if needed)
    • Model
    • Controller
    • View/UI
    • Query optimization strategy (indexes, joins, etc.)
    • Validation and security considerations
    • UX recommendations

Action:
Proceed ONLY after reviewing Task 1 feedback.

================================

🧩 Task 3: Conditional Implementation

================================

Condition A (If approach is approved):

  • Implement the feature end-to-end
  • Ensure:
    • Clean, modular code
    • No performance degradation
    • Proper indexing and optimized queries
    • Secure input handling
    • Excellent UX (fast, intuitive filtering)
  • You may refer to any file as needed

Condition B (If approach is NOT approved):

  • Refine the design
  • Provide alternative approaches
  • Continue iteration until a satisfactory solution is reached

================================

⚠️ Important Guidelines

================================

  • Always think before coding
  • Prefer optimized queries over brute-force filtering
  • Avoid N+1 query problems
  • Follow Laravel best practices (if applicable)
  • Keep separation of concerns (MVC clean)
  • Suggest improvements beyond the asked scope if valuable

Top comments (0)