diff --git a/shipkit/__init__.py b/shipkit/__init__.py index b645bf0..36a3f4c 100644 --- a/shipkit/__init__.py +++ b/shipkit/__init__.py @@ -1,3 +1,3 @@ """Shipkit — CLI-agnostic AI dev productivity kit.""" -__version__ = "0.1.14" +__version__ = "0.1.15" diff --git a/shipkit/cli.py b/shipkit/cli.py index e3ea05d..254519c 100644 --- a/shipkit/cli.py +++ b/shipkit/cli.py @@ -810,20 +810,17 @@ def run(prompt: tuple[str, ...], no_agent: bool): if not no_agent: cmd.extend(["--agent", f"shipkit v{__version__}"]) - # Build prompt — inject init hint for first-time projects - prompt_str = " ".join(prompt) if prompt else "" + # For first-time projects, inject init hint into system prompt if is_first_run and not no_agent: - init_hint = ( - "This project hasn't been configured with shipkit yet. " - "Offer to run /init to set up project-specific MCP servers and preferences." - ) - if prompt_str: - prompt_str = init_hint + " Then: " + prompt_str - else: - prompt_str = init_hint - - if prompt_str: - cmd.append(prompt_str) + cmd.extend(["--append-system-prompt", ( + "IMPORTANT: This is a new project that hasn't been set up with shipkit yet. " + "Your FIRST action must be to run the /init skill to detect the tech stack " + "and configure project-specific MCP servers. Do this before anything else." + )]) + + # Pass user prompt if provided + if prompt: + cmd.append(" ".join(prompt)) click.echo("Launching shipkit on Claude Code...") subprocess.run(cmd, check=False) diff --git a/tests/test_run.py b/tests/test_run.py index b7c7ce0..4b259f4 100644 --- a/tests/test_run.py +++ b/tests/test_run.py @@ -80,9 +80,10 @@ def test_run_first_time_injects_init_hint(self, initialized_home, tmp_repo, monk assert mock_run.called call_args = mock_run.call_args[0][0] - # Should include init hint in the prompt - prompt_arg = call_args[-1] - assert "/init" in prompt_arg + # Should include --append-system-prompt with init hint + assert "--append-system-prompt" in call_args + hint_idx = call_args.index("--append-system-prompt") + 1 + assert "/init" in call_args[hint_idx] def test_run_existing_project_no_hint(self, initialized_home, tmp_repo, monkeypatch): """Test run command does NOT inject init hint for already-initialized projects.""" @@ -102,8 +103,8 @@ def test_run_existing_project_no_hint(self, initialized_home, tmp_repo, monkeypa assert mock_run.called call_args = mock_run.call_args[0][0] - # Should NOT include any init hint (just claude + --agent) - assert len(call_args) == 3 # claude, --agent, "shipkit v..." + # Should NOT include init hint + assert "--append-system-prompt" not in call_args def test_run_with_prompt(self, initialized_home, tmp_repo, monkeypatch): """Test run command with initial prompt."""