Artificial intelligence (AI) is transforming the software engineering landscape that allows for new development approaches. This paper proposes a framework that integrates cognitive models with AI-driven code generation to enhance the software development process. By leveraging cognitive principles, the proposed system performs human-like decision-making to optimize code generation, refactor existing code, and fix bugs. The framework was evaluated based on code quality, developer productivity, usability, and system adaptability. Results demonstrate improvements by AI-driven system such as speed of code generation increased by 10% compared with human-written baseline and complexity reduced by 15% compared with human-generated code. Developers using the system reported a 25–29% reduction in task completion time, and errors were minimized by 60–67%. Usability feedback indicated that the system integrated seamlessly into developers’ workflows but requires further development, including enhanced personalization and a better understanding of complex code contexts. This study highlights the potential of AI-driven systems to assist developers in producing high-quality software more efficiently and provides a foundation for future research in AIenhanced software engineering tools.