LLMs often tackle problems without a clear understanding of the established structure or constraints of the project. This can result in actions like rewriting database schemas, changing parameters arbitrarily, or introducing inconsistencies between the front-end, back-end, and database layers—something a human developer would avoid because they inherently understand the project’s boundaries and dependencies.
To address this, it would be useful to have a system that acts as a reference for the LLM, providing it with a consistent source of truth about the project’s structure. This system could include:
- Immutable References: A file or data store that the LLM can query but not modify. This would contain essential information such as:
• API endpoints and their parameters.
• Database schemas, including tables and key-value pairs.
• Current front-end and back-end integrations.
- Versioned Context: A programmatically generated or manually maintained document (e.g., a PRD or system outline) that captures the current state of the project. The LLM could access this with every interaction to understand:
• What has already been built.
• How different components interact.
• Constraints that must not be violated.
- Change Tracking and Prioritization:
• A system to record priorities for changes, encouraging the LLM to make minimal and incremental modifications rather than large, disruptive overhauls.
• Clear rules about which files or components can be modified and which should remain untouched.
- Automated Consistency Checks:
• If the LLM proposes changes, it could first validate them against the reference system to ensure consistency across all layers (e.g., front-end, back-end, and database).
For example, tools like Windsurf prevent direct rewriting of files, which is a step in the right direction. Building on this, you could extend functionality to:
• Establish clear parameters and guidelines that are dynamically referenced by the LLM.
• Enable both manual and programmatic updates to the “source of truth” file, ensuring it stays relevant and accurate.
This approach would reduce runtime errors caused by mismatched variables or arbitrary changes and help maintain the integrity of the project while still leveraging the LLM’s ability to automate and build.