feat: Add "Expand Project" for bulk AI-powered feature creation

Adds the ability to add multiple features to an existing project through
a natural language conversation with Claude, similar to how initial spec
creation works.

Features:
- New "Expand" button in header (keyboard shortcut: E)
- Full-screen chat interface for describing new features
- Claude reads existing app_spec.txt for context
- Features created directly in database after user approval
- Bulk feature creation endpoint for batch operations

New files:
- .claude/commands/expand-project.md - Claude skill for expansion
- server/services/expand_chat_session.py - Chat session service
- server/routers/expand_project.py - WebSocket endpoint
- ui/src/components/ExpandProjectChat.tsx - Chat UI
- ui/src/components/ExpandProjectModal.tsx - Modal wrapper
- ui/src/hooks/useExpandChat.ts - WebSocket hook

Modified:
- Added POST /bulk endpoint to features router
- Added FeatureBulkCreate schemas
- Integrated Expand button and modal in App.tsx

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Dan Gentry
2026-01-09 15:56:01 -05:00
parent 122f03dc21
commit 5f06dcf464
13 changed files with 1863 additions and 6 deletions

View File

@@ -9,6 +9,8 @@ import type {
FeatureListResponse,
Feature,
FeatureCreate,
FeatureBulkCreate,
FeatureBulkCreateResponse,
AgentStatusResponse,
AgentActionResponse,
SetupStatus,
@@ -111,6 +113,16 @@ export async function skipFeature(projectName: string, featureId: number): Promi
})
}
export async function createFeaturesBulk(
projectName: string,
bulk: FeatureBulkCreate
): Promise<FeatureBulkCreateResponse> {
return fetchJSON(`/projects/${encodeURIComponent(projectName)}/features/bulk`, {
method: 'POST',
body: JSON.stringify(bulk),
})
}
// ============================================================================
// Agent API
// ============================================================================

View File

@@ -295,3 +295,37 @@ export type AssistantChatServerMessage =
| AssistantChatErrorMessage
| AssistantChatConversationCreatedMessage
| AssistantChatPongMessage
// ============================================================================
// Expand Chat Types
// ============================================================================
export interface ExpandChatFeaturesCreatedMessage {
type: 'features_created'
count: number
features: { id: number; name: string; category: string }[]
}
export interface ExpandChatCompleteMessage {
type: 'expansion_complete'
total_added: number
}
export type ExpandChatServerMessage =
| SpecChatTextMessage // Reuse text message type
| ExpandChatFeaturesCreatedMessage
| ExpandChatCompleteMessage
| SpecChatErrorMessage // Reuse error message type
| SpecChatPongMessage // Reuse pong message type
| SpecChatResponseDoneMessage // Reuse response_done type
// Bulk feature creation
export interface FeatureBulkCreate {
features: FeatureCreate[]
starting_priority?: number
}
export interface FeatureBulkCreateResponse {
created: number
features: Feature[]
}