From 2a30b47c9184ba74e8721ad8f1bb7a801bae3bbd Mon Sep 17 00:00:00 2001 From: sno Date: Fri, 20 Feb 2026 12:35:09 +0100 Subject: [PATCH] feat(cli): refine /set-project with numbered selection and exclusions --- .../workflows/0-context/list-envs/workflow.md | 4 +++- .../0-context/set-project/workflow.md | 19 +++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/bmm/workflows/0-context/list-envs/workflow.md b/src/bmm/workflows/0-context/list-envs/workflow.md index fe8fad04c..953182555 100644 --- a/src/bmm/workflows/0-context/list-envs/workflow.md +++ b/src/bmm/workflows/0-context/list-envs/workflow.md @@ -15,7 +15,9 @@ main_config: '{project-root}/_bmad/bmm/config.yaml' ### 1. Identify Environments - Use your file listing/system capabilities to examine the `{project-root}/_bmad-output/` directory. -- Identify all subdirectories within this path. Each subdirectory represents an available environment (ignore hidden directories starting with `.`). +- Identify all subdirectories within this path. Each subdirectory represents an available environment, EXCEPT: + - Ignore hidden directories starting with `.` + - Ignore standard BMAD artifact directories: `planning-artifacts`, `implementation-artifacts`, `test-artifacts`, `knowledge`, `docs`, `assets` - The root `_bmad-output/` directory itself represents the `default (root)` unset environment. ### 2. Output Results diff --git a/src/bmm/workflows/0-context/set-project/workflow.md b/src/bmm/workflows/0-context/set-project/workflow.md index df1c7ac1a..557e5ce31 100644 --- a/src/bmm/workflows/0-context/set-project/workflow.md +++ b/src/bmm/workflows/0-context/set-project/workflow.md @@ -24,14 +24,29 @@ Load and read full config from {main_config} and resolve variables and artifact 2. **Wait for Input (If Missing)**: If the user did NOT provide a project name: - Use your file listing capabilities to examine the `{project-root}/_bmad-output/` directory. - Output: A formatted list of the existing environments (subdirectories) you found, explicitly noting the `default (root)` environment. - - Ask the user: "Please select an existing environment from the list above, or type a new name to create one. Enter `CLEAR` to reset to root." + *(Exclude hidden directories and standard BMAD artifact folders like `planning-artifacts`, `implementation-artifacts`, `test-artifacts`, `knowledge`, `docs`, `assets`)* + - Present options in a numbered list format and ask the user to select by number or type a new project name: + ``` + Select a project environment: + [0] default (root) - Current location for standard artifacts + [1] project-name-1 + [2] project-name-2 + ... + + Enter a number to select, type a new project name, or enter 'CLEAR' to reset to root: + ``` - **Wait for Input.** 3. **Process Input**: Once a project name is established: - **Case: CLEAR**: - Delete file: `{project-root}/{{bmadFolderName}}/.current_project` - Output: "✅ Project context cleared. Artifacts will go to root `_bmad-output/`." - **HALT** - - **Case: Path Provided**: + - **Case: Numeric Selection**: If input is a number (0, 1, 2, etc.): + - Map the number to the corresponding environment from your earlier listing + - If number 0, treat as "CLEAR" case above + - If valid number but out of range, show error and ask again + - If valid selection, use that environment name as the path + - **Case: Path Provided** (text input): - **1. Cleanup**: Remove leading/trailing slashes and any occurrences of `_bmad-output/`. - **2. Validate Existence**: Check if `{project-root}/_bmad-output/` exists on the file system. - **If it DOES NOT exist**: