Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion commands/product.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ First, check if the file `context/product/product-definition.md` exists.

a. **Prompt intent first.** Read `<user_prompt>`. If it clearly asks to use or explore the existing codebase (e.g. "explore existing code", "use the current codebase", "brownfield"), the decision is **explore**. If it clearly opts out (e.g. "without brownfield detection", "from scratch", "ignore existing code", "greenfield"), the decision is **skip**. Interpret intent with natural-language understanding, not substring matching — "don't explore the codebase" is a **skip**, not an explore. When the prompt states a preference, act on it and do not ask.

b. **Silent prompt.** If `<user_prompt>` says nothing either way, check whether the project already has source code by looking for common indicators (`src/`, `app/`, `lib/`, `package.json`, `requirements.txt`, `go.mod`, `Cargo.toml`, `pom.xml`, `Gemfile`, `build.gradle`, `*.csproj`, `Makefile`, `CMakeLists.txt`, `setup.py`, `pyproject.toml`, or similar). If none are found, the decision is **skip**. If any are found, ask the user with `AskUserQuestion` — **Yes, explore the codebase** ("Use existing code as context for the product definition") and **No, start from scratch** ("Treat this as a new project — ignore existing code"). This question is reached only in an interactive run whose prompt expressed no preference; an unattended run states its choice in the prompt.
b. **Silent prompt.** If `<user_prompt>` says nothing either way, check whether the project already has source code by looking for common indicators (`src/`, `app/`, `lib/`, `package.json`, `requirements.txt`, `go.mod`, `Cargo.toml`, `pom.xml`, `Gemfile`, `build.gradle`, `*.csproj`, `Makefile`, `CMakeLists.txt`, `setup.py`, `pyproject.toml`, or similar). If none are found, the decision is **skip**. If any are found, always ask the user with `AskUserQuestion` — **Yes, explore the codebase** ("Use existing code as context for the product definition") and **No, start from scratch** ("Treat this as a new project — ignore existing code"), using these exact option labels. If the question goes unanswered, default to **Yes, explore the codebase** and continue.

2. **If the decision is explore,** run a comprehensive exploration before drafting:

Expand Down
Loading