@@ -6,15 +6,11 @@ import (
66)
77
88func TestGetPrompt (t * testing.T ) {
9- prdPath := "/path/to/prd.json"
109 progressPath := "/path/to/progress.md"
1110 storyContext := `{"id":"US-001","title":"Test Story"}`
12- prompt := GetPrompt (prdPath , progressPath , storyContext , "US-001" , "Test Story" )
11+ prompt := GetPrompt (progressPath , storyContext , "US-001" , "Test Story" )
1312
1413 // Verify all placeholders were substituted
15- if strings .Contains (prompt , "{{PRD_PATH}}" ) {
16- t .Error ("Expected {{PRD_PATH}} to be substituted" )
17- }
1814 if strings .Contains (prompt , "{{PROGRESS_PATH}}" ) {
1915 t .Error ("Expected {{PROGRESS_PATH}} to be substituted" )
2016 }
@@ -33,11 +29,6 @@ func TestGetPrompt(t *testing.T) {
3329 t .Error ("Expected prompt to contain exact commit message 'feat: US-001 - Test Story'" )
3430 }
3531
36- // Verify the PRD path appears in the prompt
37- if ! strings .Contains (prompt , prdPath ) {
38- t .Errorf ("Expected prompt to contain PRD path %q" , prdPath )
39- }
40-
4132 // Verify the progress path appears in the prompt
4233 if ! strings .Contains (prompt , progressPath ) {
4334 t .Errorf ("Expected prompt to contain progress path %q" , progressPath )
@@ -48,22 +39,14 @@ func TestGetPrompt(t *testing.T) {
4839 t .Error ("Expected prompt to contain inlined story context" )
4940 }
5041
51- // Verify the prompt contains key instructions
52- if ! strings .Contains (prompt , "chief-complete" ) {
53- t .Error ("Expected prompt to contain chief-complete instruction" )
54- }
55-
56- if ! strings .Contains (prompt , "ralph-status" ) {
57- t .Error ("Expected prompt to contain ralph-status instruction" )
58- }
59-
60- if ! strings .Contains (prompt , "passes: true" ) {
61- t .Error ("Expected prompt to contain passes: true instruction" )
42+ // Verify the prompt contains chief-done stop condition
43+ if ! strings .Contains (prompt , "chief-done" ) {
44+ t .Error ("Expected prompt to contain chief-done instruction" )
6245 }
6346}
6447
6548func TestGetPrompt_NoFileReadInstruction (t * testing.T ) {
66- prompt := GetPrompt ("/path/prd.json" , "/path/ progress.md" , `{"id":"US-001"}` , "US-001" , "Test Story" )
49+ prompt := GetPrompt ("/path/progress.md" , `{"id":"US-001"}` , "US-001" , "Test Story" )
6750
6851 // The prompt should NOT instruct Claude to read the PRD file
6952 if strings .Contains (prompt , "Read the PRD" ) {
@@ -78,7 +61,7 @@ func TestPromptTemplateNotEmpty(t *testing.T) {
7861}
7962
8063func TestGetPrompt_ChiefExclusion (t * testing.T ) {
81- prompt := GetPrompt ("/path/prd.json" , "/path/ progress.md" , `{"id":"US-001"}` , "US-001" , "Test Story" )
64+ prompt := GetPrompt ("/path/progress.md" , `{"id":"US-001"}` , "US-001" , "Test Story" )
8265
8366 // The prompt must instruct Claude to never stage or commit .chief/ files
8467 if ! strings .Contains (prompt , ".chief/" ) {
@@ -87,74 +70,6 @@ func TestGetPrompt_ChiefExclusion(t *testing.T) {
8770 if ! strings .Contains (prompt , "NEVER stage or commit" ) {
8871 t .Error ("Expected prompt to explicitly say NEVER stage or commit .chief/ files" )
8972 }
90- // The commit step should not say "commit ALL changes" anymore
91- if strings .Contains (prompt , "commit ALL changes" ) {
92- t .Error ("Expected prompt to NOT say 'commit ALL changes' — it should exclude .chief/ files" )
93- }
94- }
95-
96- func TestGetConvertPrompt (t * testing.T ) {
97- prdFilePath := "/path/to/prds/main/prd.md"
98- prompt := GetConvertPrompt (prdFilePath , "US" )
99-
100- // Verify the prompt is not empty
101- if prompt == "" {
102- t .Error ("Expected GetConvertPrompt() to return non-empty prompt" )
103- }
104-
105- // Verify file path is substituted (not inlined content)
106- if ! strings .Contains (prompt , prdFilePath ) {
107- t .Error ("Expected prompt to contain the PRD file path" )
108- }
109- if strings .Contains (prompt , "{{PRD_FILE_PATH}}" ) {
110- t .Error ("Expected {{PRD_FILE_PATH}} to be substituted" )
111- }
112-
113- // Verify the old {{PRD_CONTENT}} placeholder is completely removed
114- if strings .Contains (prompt , "{{PRD_CONTENT}}" ) {
115- t .Error ("Expected {{PRD_CONTENT}} placeholder to be completely removed" )
116- }
117-
118- // Verify ID prefix is substituted
119- if strings .Contains (prompt , "{{ID_PREFIX}}" ) {
120- t .Error ("Expected {{ID_PREFIX}} to be substituted" )
121- }
122- if ! strings .Contains (prompt , "US-001" ) {
123- t .Error ("Expected prompt to contain US-001 when prefix is US" )
124- }
125-
126- // Verify key instructions are present
127- if ! strings .Contains (prompt , "JSON" ) {
128- t .Error ("Expected prompt to mention JSON" )
129- }
130-
131- if ! strings .Contains (prompt , "userStories" ) {
132- t .Error ("Expected prompt to describe userStories structure" )
133- }
134-
135- if ! strings .Contains (prompt , `"passes": false` ) {
136- t .Error ("Expected prompt to specify passes: false default" )
137- }
138-
139- // Verify prompt instructs Claude to read the file
140- if ! strings .Contains (prompt , "Read the PRD file" ) {
141- t .Error ("Expected prompt to instruct Claude to read the PRD file" )
142- }
143- }
144-
145- func TestGetConvertPrompt_CustomPrefix (t * testing.T ) {
146- prompt := GetConvertPrompt ("/path/prd.md" , "MFR" )
147-
148- // Verify custom prefix is used, not hardcoded US
149- if strings .Contains (prompt , "{{ID_PREFIX}}" ) {
150- t .Error ("Expected {{ID_PREFIX}} to be substituted" )
151- }
152- if ! strings .Contains (prompt , "MFR-001" ) {
153- t .Error ("Expected prompt to contain MFR-001 when prefix is MFR" )
154- }
155- if ! strings .Contains (prompt , "MFR-002" ) {
156- t .Error ("Expected prompt to contain MFR-002 when prefix is MFR" )
157- }
15873}
15974
16075func TestGetInitPrompt (t * testing.T ) {
0 commit comments