From 3dfb4442883e05fb4df0ca1a9982db6c4ffb9531 Mon Sep 17 00:00:00 2001 From: Kota Shirakura Date: Sun, 24 Aug 2025 12:55:04 +0900 Subject: [PATCH] chore(bmad-core): add prose mode --- .../tasks/create-front-end-spec-from-wireframe.md | 3 +++ bmad-core/templates/architecture-tmpl.yaml | 2 +- bmad-core/templates/front-end-architecture-tmpl.yaml | 2 +- bmad-core/templates/front-end-spec-tmpl.yaml | 7 ++++--- bmad-core/templates/fullstack-architecture-tmpl.yaml | 3 ++- bmad-core/templates/prd-tmpl.yaml | 10 ++++++---- common/tasks/create-doc.md | 10 ++++++++++ 7 files changed, 27 insertions(+), 10 deletions(-) diff --git a/bmad-core/tasks/create-front-end-spec-from-wireframe.md b/bmad-core/tasks/create-front-end-spec-from-wireframe.md index c16a5751..d8b754aa 100644 --- a/bmad-core/tasks/create-front-end-spec-from-wireframe.md +++ b/bmad-core/tasks/create-front-end-spec-from-wireframe.md @@ -22,6 +22,8 @@ 4. テンプレート `front-end-spec-tmpl.yaml` を用いて仕様書を作成 - 変数: `screen_id`, `wireframe_screenshot_relpath`(例: `../assets/{{screen_id}}-wireframe.png`) 5. 生成された仕様書に「Wireframe Screenshots」セクションが含まれることを確認 +6. (任意)プローズモードでの出力 + - `export BMAD_STYLE=prose` を設定してからレンダリングを行うと、箇条書き中心の短文ではなく、段落ベースの詳細な説明が優先される。 ## Execution Notes - 撮影後に画像パスを相対に変換し、仕様書から参照可能にします。 @@ -53,6 +55,7 @@ print(out_abs) PY # 3) Render from template (tooling-dependent - example placeholder) +# export BMAD_STYLE=prose # bmad render --template {root}/templates/front-end-spec-tmpl.yaml \ # --out documents/frontend_spec/${BMAD_SCREEN_ID}.md \ # --var screen_id=${BMAD_SCREEN_ID} \ diff --git a/bmad-core/templates/architecture-tmpl.yaml b/bmad-core/templates/architecture-tmpl.yaml index f5d508aa..2af1299b 100644 --- a/bmad-core/templates/architecture-tmpl.yaml +++ b/bmad-core/templates/architecture-tmpl.yaml @@ -68,7 +68,7 @@ sections: - id: high-level-architecture title: High Level Architecture instruction: | - This section contains multiple subsections that establish the foundation of the architecture. Present all subsections together at once. + This section contains multiple subsections that establish the foundation of the architecture. Present all subsections together at once. When BMAD_STYLE=prose, precede any lists or diagrams with paragraph narratives that explain the why behind choices, trade-offs, and how this architecture satisfies PRD goals. elicit: true sections: - id: technical-summary diff --git a/bmad-core/templates/front-end-architecture-tmpl.yaml b/bmad-core/templates/front-end-architecture-tmpl.yaml index 4ef2db43..f960666d 100644 --- a/bmad-core/templates/front-end-architecture-tmpl.yaml +++ b/bmad-core/templates/front-end-architecture-tmpl.yaml @@ -107,7 +107,7 @@ sections: - id: component-standards title: Component Standards - instruction: Define exact patterns for component creation based on the chosen framework. + instruction: Define exact patterns for component creation based on the chosen framework. In prose mode, describe the intent and rationale for each rule in paragraph form before providing code templates. elicit: true sections: - id: component-template diff --git a/bmad-core/templates/front-end-spec-tmpl.yaml b/bmad-core/templates/front-end-spec-tmpl.yaml index 7e66e3e4..5e97885c 100644 --- a/bmad-core/templates/front-end-spec-tmpl.yaml +++ b/bmad-core/templates/front-end-spec-tmpl.yaml @@ -66,7 +66,7 @@ sections: - id: information-architecture title: Information Architecture (IA) instruction: | - Collaborate with the user to create a comprehensive information architecture: + Collaborate with the user to create a comprehensive information architecture. When BMAD_STYLE=prose, describe structures and rationale in paragraphs first, then add diagrams for support (not as the sole content): 1. Build a Site Map or Screen Inventory showing all major areas 2. Define the Navigation Structure (primary, secondary, breadcrumbs) @@ -105,7 +105,7 @@ sections: - id: screen-transitions title: Screen Transitions instruction: | - Document how users move between screens at an application level. + Document how users move between screens at an application level. In prose mode, explain the entry points, decision points, and outcomes in full sentences before the diagram. Avoid terse bullet-only descriptions. - Use Mermaid flow diagrams to visualize transitions - Include decision points (permissions, confirmations) as diamond nodes @@ -174,7 +174,7 @@ sections: - id: wireframes-mockups title: Wireframes & Mockups instruction: | - Clarify where detailed visual designs will be created (Figma, Sketch, etc.) and how to reference them. If low-fidelity wireframes are needed, offer to help conceptualize layouts for key screens. + Clarify where detailed visual designs will be created (Figma, Sketch, etc.) and how to reference them. If low-fidelity wireframes are needed, offer to help conceptualize layouts for key screens. In prose mode, describe each screenshot’s purpose, key elements, and intended interactions in sentences, not only bullets. elicit: true sections: - id: wireframe-screenshots @@ -280,6 +280,7 @@ sections: - id: accessibility title: Accessibility Requirements instruction: Define specific accessibility requirements based on target compliance level and user needs. Be comprehensive but practical. + note: "When BMAD_STYLE=prose, precede lists with paragraphs that explain goals and rationale." elicit: true sections: - id: compliance-target diff --git a/bmad-core/templates/fullstack-architecture-tmpl.yaml b/bmad-core/templates/fullstack-architecture-tmpl.yaml index a5d2c1d3..deafdac1 100644 --- a/bmad-core/templates/fullstack-architecture-tmpl.yaml +++ b/bmad-core/templates/fullstack-architecture-tmpl.yaml @@ -56,7 +56,8 @@ sections: - id: high-level-architecture title: High Level Architecture - instruction: This section contains multiple subsections that establish the foundation. Present all subsections together, then elicit feedback on the complete section. + instruction: | + This section contains multiple subsections that establish the foundation. Present all subsections together, then elicit feedback on the complete section. When BMAD_STYLE=prose, provide paragraph narratives explaining purpose, trade-offs, and alignment to PRD before any lists or diagrams. elicit: true sections: - id: technical-summary diff --git a/bmad-core/templates/prd-tmpl.yaml b/bmad-core/templates/prd-tmpl.yaml index 804f6d45..654ff04f 100644 --- a/bmad-core/templates/prd-tmpl.yaml +++ b/bmad-core/templates/prd-tmpl.yaml @@ -16,7 +16,9 @@ sections: - id: goals-context title: Goals and Background Context instruction: | - Ask if Project Brief document is available. If NO Project Brief exists, STRONGLY recommend creating one first using project-brief-tmpl (it provides essential foundation: problem statement, target users, success metrics, MVP scope, constraints). If user insists on PRD without brief, gather this information during Goals section. If Project Brief exists, review and use it to populate Goals (bullet list of desired outcomes) and Background Context (1-2 paragraphs on what this solves and why) so we can determine what is and is not in scope for PRD mvp. Either way this is critical to determine the requirements. Include Change Log table. + Ask if Project Brief document is available. If NO Project Brief exists, STRONGLY recommend creating one first using project-brief-tmpl. If user insists on PRD without brief, gather this information during Goals section. + + When BMAD_STYLE=prose, ensure the Background Context and subsequent sections open with paragraph explanations: clearly state the problem, users, constraints, and rationale before any lists or tables. sections: - id: goals title: Goals @@ -34,21 +36,21 @@ sections: - id: requirements title: Requirements - instruction: Draft the list of functional and non functional requirements under the two child sections + instruction: Draft the list of functional and non functional requirements under the two child sections. In prose mode, for each requirement, add a short explanatory paragraph (purpose, preconditions, acceptance) beneath the item, avoiding single-line shorthand. elicit: true sections: - id: functional title: Functional type: numbered-list prefix: FR - instruction: Each Requirement will be a bullet markdown and an identifier sequence starting with FR + instruction: Each Requirement will be a numbered item starting with FR. In prose mode, follow each FR with a paragraph explaining rationale, conditions, and acceptance. examples: - "FR6: The Todo List uses AI to detect and warn against potentially duplicate todo items that are worded differently." - id: non-functional title: Non Functional type: numbered-list prefix: NFR - instruction: Each Requirement will be a bullet markdown and an identifier sequence starting with NFR + instruction: Each Requirement will be a numbered item starting with NFR. In prose mode, follow each NFR with a paragraph explaining rationale and measurement. examples: - "NFR1: AWS service usage must aim to stay within free-tier limits where feasible." diff --git a/common/tasks/create-doc.md b/common/tasks/create-doc.md index a3d62b44..a414bdf7 100644 --- a/common/tasks/create-doc.md +++ b/common/tasks/create-doc.md @@ -37,6 +37,16 @@ If a YAML Template has not been provided, list all templates from .bmad-core/tem **NEVER ask yes/no questions or use any other format.** +## Global Prose Mode (BMAD_STYLE=prose) + +When the environment variable `BMAD_STYLE=prose` is set: + +1. Write sections in full sentences and paragraphs. Avoid shorthand. +2. Do not use terse bullet-only outputs unless identifiers are mandatory (e.g., FR/NFR numbers). When lists are necessary, convert each item into 1-2 descriptive sentences. +3. Always cover, in order where applicable: Purpose → Structure → Behavior → Conditions → Results → Errors/Edge Cases → Accessibility/Non-Functional → Acceptance. +4. Replace ambiguous shorthand with explicit phrasing. Example: “1行省略” → “1行表示領域を超えたテキストは末尾に省略記号(…)を付けて切り詰める”。 +5. Prefer paragraph explanations before any diagrams or tables to clarify context and rationale. + ## Processing Flow 1. **Parse YAML template** - Load template metadata and sections