@@ -36,7 +36,7 @@ def teardown_method(self):
3636 os .chdir (str (repo_root ))
3737
3838 def test_init_current_directory (self ):
39- """Test initialization in current directory (minimal mode) ."""
39+ """Test initialization in current directory."""
4040 with tempfile .TemporaryDirectory () as tmp_dir :
4141 os .chdir (tmp_dir )
4242 try :
@@ -46,15 +46,16 @@ def test_init_current_directory(self):
4646 assert result .exit_code == 0
4747 assert "APM project initialized successfully!" in result .output
4848 assert Path ("apm.yml" ).exists ()
49- # Minimal mode: no template files created
49+ assert Path ("start.prompt.md" ).exists ()
50+ # No extra template files created
5051 assert not Path ("hello-world.prompt.md" ).exists ()
5152 assert not Path ("README.md" ).exists ()
5253 assert not Path (".apm" ).exists ()
5354 finally :
5455 os .chdir (self .original_dir ) # restore CWD before TemporaryDirectory cleanup
5556
5657 def test_init_explicit_current_directory (self ):
57- """Test initialization with explicit '.' argument (minimal mode) ."""
58+ """Test initialization with explicit '.' argument."""
5859 with tempfile .TemporaryDirectory () as tmp_dir :
5960 os .chdir (tmp_dir )
6061 try :
@@ -64,13 +65,14 @@ def test_init_explicit_current_directory(self):
6465 assert result .exit_code == 0
6566 assert "APM project initialized successfully!" in result .output
6667 assert Path ("apm.yml" ).exists ()
67- # Minimal mode: no template files created
68+ assert Path ("start.prompt.md" ).exists ()
69+ # No extra template files created
6870 assert not Path ("hello-world.prompt.md" ).exists ()
6971 finally :
7072 os .chdir (self .original_dir ) # restore CWD before TemporaryDirectory cleanup
7173
7274 def test_init_new_directory (self ):
73- """Test initialization in new directory (minimal mode) ."""
75+ """Test initialization in new directory."""
7476 with tempfile .TemporaryDirectory () as tmp_dir :
7577 os .chdir (tmp_dir )
7678 try :
@@ -84,7 +86,8 @@ def test_init_new_directory(self):
8486 assert project_path .exists ()
8587 assert project_path .is_dir ()
8688 assert (project_path / "apm.yml" ).exists ()
87- # Minimal mode: no template files created
89+ assert (project_path / "start.prompt.md" ).exists ()
90+ # No extra template files created
8891 assert not (project_path / "hello-world.prompt.md" ).exists ()
8992 assert not (project_path / "README.md" ).exists ()
9093 assert not (project_path / ".apm" ).exists ()
@@ -221,7 +224,7 @@ def test_init_existing_project_interactive_cancel(self):
221224 os .chdir (self .original_dir ) # restore CWD before TemporaryDirectory cleanup
222225
223226 def test_init_validates_project_structure (self ):
224- """Test that init creates minimal project structure."""
227+ """Test that init creates expected project structure."""
225228 with tempfile .TemporaryDirectory () as tmp_dir :
226229 os .chdir (tmp_dir )
227230 try :
@@ -243,7 +246,9 @@ def test_init_validates_project_structure(self):
243246 assert "scripts" in config
244247 assert config ["scripts" ] == {}
245248
246- # Minimal mode: no template files created
249+ # start.prompt.md created
250+ assert (project_path / "start.prompt.md" ).exists ()
251+ # No extra template files created
247252 assert not (project_path / "hello-world.prompt.md" ).exists ()
248253 assert not (project_path / "README.md" ).exists ()
249254 assert not (project_path / ".apm" ).exists ()
@@ -296,6 +301,71 @@ def test_init_does_not_create_skill_md(self):
296301 finally :
297302 os .chdir (self .original_dir ) # restore CWD before TemporaryDirectory cleanup
298303
304+ def test_init_creates_start_prompt_md (self ):
305+ """Test that init creates start.prompt.md with correct content."""
306+ with tempfile .TemporaryDirectory () as tmp_dir :
307+ os .chdir (tmp_dir )
308+ try :
309+ result = self .runner .invoke (cli , ["init" , "--yes" ])
310+
311+ assert result .exit_code == 0
312+ prompt_path = Path ("start.prompt.md" )
313+ assert prompt_path .exists ()
314+
315+ content = prompt_path .read_text (encoding = "utf-8" )
316+ assert "---" in content
317+ assert "name: start" in content
318+ assert "You are a helpful assistant" in content
319+ finally :
320+ os .chdir (self .original_dir )
321+
322+ def test_init_does_not_overwrite_existing_start_prompt (self ):
323+ """Test that init preserves existing start.prompt.md (brownfield)."""
324+ with tempfile .TemporaryDirectory () as tmp_dir :
325+ os .chdir (tmp_dir )
326+ try :
327+ # Create existing start.prompt.md with custom content
328+ Path ("start.prompt.md" ).write_text (
329+ "---\n name: start\n ---\n My custom prompt\n " , encoding = "utf-8"
330+ )
331+
332+ result = self .runner .invoke (cli , ["init" , "--yes" ])
333+
334+ assert result .exit_code == 0
335+ content = Path ("start.prompt.md" ).read_text (encoding = "utf-8" )
336+ assert "My custom prompt" in content
337+ assert "start.prompt.md already exists" in result .output
338+ finally :
339+ os .chdir (self .original_dir )
340+
341+ def test_init_next_steps_no_compile (self ):
342+ """Test that next steps do not reference apm compile."""
343+ with tempfile .TemporaryDirectory () as tmp_dir :
344+ os .chdir (tmp_dir )
345+ try :
346+ result = self .runner .invoke (cli , ["init" , "--yes" ])
347+
348+ assert result .exit_code == 0
349+ assert "apm compile" not in result .output
350+ assert "Edit your prompt" in result .output
351+ assert "start.prompt.md" in result .output
352+ assert "apm run start" in result .output
353+ finally :
354+ os .chdir (self .original_dir )
355+
356+ def test_init_created_files_table_includes_start_prompt (self ):
357+ """Test that Created Files table lists start.prompt.md."""
358+ with tempfile .TemporaryDirectory () as tmp_dir :
359+ os .chdir (tmp_dir )
360+ try :
361+ result = self .runner .invoke (cli , ["init" , "--yes" ])
362+
363+ assert result .exit_code == 0
364+ # start.prompt.md appears in the Created Files table
365+ assert "start.prompt.md" in result .output
366+ finally :
367+ os .chdir (self .original_dir )
368+
299369
300370
301371class TestPluginNameValidation :
0 commit comments