- ✅ Added
base_llm_promptcolumn to projects table with default template - ✅ Added
component_pathcolumn to system_components table for filesystem mapping - ✅ Updated database migration function to handle existing databases
- ✅ Updated Project struct to include BaseLLMPrompt field
- ✅ Created comprehensive implementation plan in
LLM_INTEGRATION_PLAN.md - ✅ Defined API endpoint structure
- ✅ Designed UI component layout
- ✅ Specified prompt generation hierarchy (component → story → spec)
- ✅ Documented filesystem integration approach
The current code has compilation errors due to missing database methods. The following methods need to be implemented:
// Missing database methods
func (db *DB) GetComponentByID(id string) (*ComponentSummary, error)
func (db *DB) GetProjectByID(id string) (*Project, error)
func (db *DB) GetRequirementsByComponent(componentID string) ([]*RequirementSummary, error)
func (db *DB) GetRequirementByID(id string) (*RequirementSummary, error)
func (db *DB) GetChildRequirements(parentID string) ([]*RequirementSummary, error)The full LLM integration is quite complex and requires:
- New database query methods
- Complex prompt building logic
- Hierarchical requirement traversal
- API error handling
- Frontend integration
Goal: Show the concept with working UI buttons and placeholder functionality
-
Add UI Buttons to project-page.html:
<!-- Component level --> <button onclick="showLLMPromptModal('component', componentId)">🤖 Generate Code</button> <!-- Story level --> <button onclick="showLLMPromptModal('story', storyId)">🤖 Generate Story Code</button> <!-- Spec level --> <button onclick="showLLMPromptModal('spec', specId)">🤖 Generate Spec Code</button>
-
Create Placeholder Modal:
<div id="llmPromptModal"> <h3>LLM Code Generation</h3> <p>Context Level: {level}</p> <textarea>Placeholder prompt will be generated here...</textarea> <button onclick="copyToClipboard()">📋 Copy to Clipboard</button> </div>
-
Basic JavaScript:
function showLLMPromptModal(level, itemId) { // Show modal with placeholder content // Future: Make API call to generate actual prompt }
- Implement missing database methods
- Add API endpoints for prompt generation
- Implement source tree and test suite viewers
- Add base prompt editor
- Connect frontend to backend APIs
- Add filesystem parsing for source tree
- Add test case discovery
- Add LLM API integration (optional)
internal/database/sqlite.go- Added database schema changescmd/serve.go- Attempted API implementation (needs cleanup)
LLM_INTEGRATION_PLAN.md- Complete implementation planLLM_INTEGRATION_STATUS.md- This status document
Start with Phase 1 - Add the UI buttons and placeholder modals to:
- Show users the intended functionality
- Get feedback on the UI design
- Validate the approach before full implementation
- Allow incremental development
This approach lets us:
- ✅ Demonstrate the concept immediately
- ✅ Gather user feedback
- ✅ Avoid complex debugging
- ✅ Build iteratively
The database schema changes are already in place, so the foundation is ready for the full implementation when we're ready to tackle the complex backend logic.
The database is ready with:
-- Projects table has base_llm_prompt column
ALTER TABLE projects ADD COLUMN base_llm_prompt TEXT DEFAULT '...'
-- Components table has component_path column
ALTER TABLE system_components ADD COLUMN component_path TEXTThese migrations will run automatically on existing databases.