story-kit: merge 148_story_interactive_onboarding_guides_user_through_project_setup_after_init
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use crate::slog;
|
||||
use crate::llm::prompts::SYSTEM_PROMPT;
|
||||
use crate::io::onboarding;
|
||||
use crate::llm::prompts::{ONBOARDING_PROMPT, SYSTEM_PROMPT};
|
||||
use crate::llm::providers::claude_code::ClaudeCodeResult;
|
||||
use crate::llm::types::{Message, Role, ToolCall, ToolDefinition, ToolFunctionDefinition};
|
||||
use crate::state::SessionState;
|
||||
@@ -278,11 +279,25 @@ where
|
||||
|
||||
let mut current_history = messages.clone();
|
||||
|
||||
// Build the system prompt — append onboarding instructions when the
|
||||
// project's spec files still contain scaffold placeholders.
|
||||
let system_content = {
|
||||
let mut content = SYSTEM_PROMPT.to_string();
|
||||
if let Ok(root) = state.get_project_root() {
|
||||
let status = onboarding::check_onboarding_status(&root);
|
||||
if status.needs_onboarding() {
|
||||
content.push_str("\n\n");
|
||||
content.push_str(ONBOARDING_PROMPT);
|
||||
}
|
||||
}
|
||||
content
|
||||
};
|
||||
|
||||
current_history.insert(
|
||||
0,
|
||||
Message {
|
||||
role: Role::System,
|
||||
content: SYSTEM_PROMPT.to_string(),
|
||||
content: system_content,
|
||||
tool_calls: None,
|
||||
tool_call_id: None,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user