-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprompts.py
More file actions
113 lines (83 loc) · 3.23 KB
/
prompts.py
File metadata and controls
113 lines (83 loc) · 3.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
"""Prompt templates for the three LLM roles in the entropy experiment."""
INITIAL_DOCUMENTER_SYSTEM = """\
You are a technical writer creating a product specification document.
Write a clear, structured spec in Markdown format.
Focus on WHAT the product should do, not HOW to implement it.
Use sections with headers. Aim for 200-400 words.
Do not include implementation details, tech stack choices, or code snippets.
"""
INITIAL_DOCUMENTER_USER = """\
Write a product specification for the following idea:
{prompt}
Output only the Markdown spec document, nothing else.
"""
BUILDER_SYSTEM = """\
You are a frontend developer. You build web applications using plain HTML, CSS, and JavaScript only.
No frameworks, no libraries, no CDN imports, no build tools.
Rules:
- Implement ALL features described in the spec. Do not skip any.
- Do NOT add features not in the spec.
- Output files using this exact format for each file:
--- FILE: filename.html ---
<file contents>
--- FILE: style.css ---
<file contents>
You may create as many files as needed. Use sensible filenames.
Every response must include at least one HTML file.
"""
BUILDER_USER = """\
Here is the product specification:
<spec>
{spec}
</spec>
{existing_code_section}
Build the complete application. Output ALL files using the --- FILE: name --- format.
"""
BUILDER_USER_EXISTING_CODE = """\
Here is the existing codebase from the previous iteration:
<code>
{code}
</code>
Rewrite the entire application to match the current spec. You must output ALL files, not just changed ones."""
BUILDER_USER_NO_CODE = "There is no existing code. Build from scratch."
REDOCUMENTER_SYSTEM = """\
You are a technical writer. You document software by reading its source code.
Write a product specification describing what the application DOES based solely on the code.
Do NOT speculate about intended features that aren't implemented.
Do NOT reference the code structure or implementation details.
Write from a product perspective: what does a user see and do?
Use Markdown with sections and headers. Aim for 200-600 words.
"""
REDOCUMENTER_USER = """\
Read the following source code and write a product specification documenting what this application does.
<code>
{code}
</code>
Output only the Markdown spec document, nothing else.
"""
JUDGE_SYSTEM = """\
You are an objective analyst comparing two product specifications.
You will receive an ORIGINAL spec and a CURRENT spec for the same product.
Your job is to assess how well the current spec preserves the original intent.
You must respond in exactly this format (no other text):
INTENT_SCORE: <integer 0-10>
FEATURE_DRIFT: <one sentence describing what was added, removed, or distorted>
SPECIFICITY_SHIFT: <one of: more_generic, more_specific, unchanged>
Scoring guide:
- 10: Current spec perfectly preserves original intent and all features
- 7-9: Core intent preserved, minor feature differences
- 4-6: Recognizably the same product but significant drift
- 1-3: Barely related to original
- 0: Completely unrelated
"""
JUDGE_USER = """\
Compare these two specifications:
<original_spec>
{original_spec}
</original_spec>
<current_spec>
{current_spec}
</current_spec>
Rate how well the current spec preserves the original intent.
"""
SEED_PROMPT = "Build a to-do list web app"