mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-02 08:33:36 +00:00
initial commit
This commit is contained in:
37
reference/prompts.py
Normal file
37
reference/prompts.py
Normal file
@@ -0,0 +1,37 @@
|
||||
"""
|
||||
Prompt Loading Utilities
|
||||
========================
|
||||
|
||||
Functions for loading prompt templates from the prompts directory.
|
||||
"""
|
||||
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
PROMPTS_DIR = Path(__file__).parent / "prompts"
|
||||
|
||||
|
||||
def load_prompt(name: str) -> str:
|
||||
"""Load a prompt template from the prompts directory."""
|
||||
prompt_path = PROMPTS_DIR / f"{name}.md"
|
||||
return prompt_path.read_text()
|
||||
|
||||
|
||||
def get_initializer_prompt() -> str:
|
||||
"""Load the initializer prompt."""
|
||||
return load_prompt("initializer_prompt")
|
||||
|
||||
|
||||
def get_coding_prompt() -> str:
|
||||
"""Load the coding agent prompt."""
|
||||
return load_prompt("coding_prompt")
|
||||
|
||||
|
||||
def copy_spec_to_project(project_dir: Path) -> None:
|
||||
"""Copy the app spec file into the project directory for the agent to read."""
|
||||
spec_source = PROMPTS_DIR / "app_spec.txt"
|
||||
spec_dest = project_dir / "app_spec.txt"
|
||||
if not spec_dest.exists():
|
||||
shutil.copy(spec_source, spec_dest)
|
||||
print("Copied app_spec.txt to project directory")
|
||||
Reference in New Issue
Block a user