Commit Graph

2 Commits

Author SHA1 Message Date
Brian cd8ac7e9aa
bmm: standardize memlog usage across skills (#2483)
* bmm: standardize memlog usage across skills

- Point all memlog writes at the canonical core script (uv {project-root}/_bmad/scripts/memlog.py) in bmad-spec, bmad-brainstorming, and bmad-architecture; drop the python3/{skill-root} invocations and remove the bundled memlog.py copy from bmad-brainstorming.
- Migrate bmad-prd, bmad-ux, and bmad-product-brief off the hand-authored decision-log.md onto the memlog standard: .memlog.md written only via memlog.py (init/append), distilled-toward not authored, no lifecycle status; rename the headless decision_log JSON key to memlog.
- Fix bmad-spec capability rendering: nested bullets so intent/success break onto their own lines instead of collapsing into one blob.
- Update EN + FR docs (getting-started, workflow-map, core-tools) to reference .memlog.md.
- Remove the bmad-product-brief eval suite (to be replaced with a new format).

* bmm: invoke scripts with 'uv run' instead of python3/bare uv

Bare 'uv {path}.py' does not execute (uv treats the path as a subcommand and errors); only 'uv run {path}' runs the script. Fixes the broken bare-uv memlog form shipped earlier in this branch and converts python3 script calls to 'uv run' across the 6 touched skills (memlog.py, resolve_customization.py, brain.py, lint_spine.py). Inline 'python3 -c' one-liners and .py shebangs are left as-is.

* bmm: address PR review on memlog standardization

- Delete orphaned bmad-brainstorming/scripts/tests/test_memlog.py: it
  imported the bundled memlog.py removed in this PR (ModuleNotFoundError on
  collection) and its unique tests asserted the now-removed status-lifecycle
  behavior. The canonical src/scripts/tests/test_memlog.py is the corrected
  superset, so no coverage is lost.
- Make runnable memlog command examples self-contained with the full
  'uv run {project-root}/_bmad/scripts/memlog.py ... --workspace {doc_workspace}'
  form across bmad-brainstorming (converge/finalize/headless), bmad-prd, and
  bmad-ux. Terse checklist back-references left short by design.
- bmad-product-brief Update: init .memlog.md if missing (legacy/pre-standard
  briefs), matching bmad-prd and bmad-ux; fix the --type override invocation.
2026-06-20 17:47:12 -05:00
Brian 71136bc6af
feat(bmad-prd): overhaul facilitation, discipline, and validation (#2385)
* feat(bmad-prd): voice rules, probing reference, and operational hardening

- Session Posture section (voice prohibitions, record-as-you-go, anti-caving, register-matching)
- New references/probing.md: seven probing categories, six critical assumptions, PRD/solution-design boundary
- Intent detection signals (create/update/validate) on activation step 6
- Update intent: inline conflict-detection procedure against decision-log.md
- Activation step 1 falls back to customize.toml instead of halting on resolver failure
- Restructure Discovery into five sub-sections (Posture, Brain dump, Four-dimension read, Right-skill check, Working mode)
- Regroup PRD Discipline into three clusters (Artifact shape, Substance, Honesty about scope)
- Define phase-blockers in Finalize step 4
- Em-dash strip in prose; preserve [v2 — out of MVP] callout convention
- Move bmad-party-mode / bmad-advanced-elicitation mention into the greeting step

* feat(bmad-prd): funnel discipline, UJ depth, and UX reframing

Template discipline for downstream AI extraction:
- §3 Glossary: exact-use enforcement (FRs, UJs, SMs use Glossary terms verbatim)
- §4 Features: FRs now use "#### FR-N: Name" heading with Realizes UJ-X cross-reference, testable consequences, and optional per-FR Out of Scope
- §7 Success Metrics: SM-N / SM-CN numbering with Validates FR-X cross-reference

User journeys:
- §2.4 UJ format expanded from one-liner to named-persona mini-flow (persona, 3-5 steps, edge cases, optional capability surfacing); hobby can collapse to one-liners
- Strip "job of UX" / "not this PRD" gatekeeping from template; depth is the team's call
- Strengthen UX-as-input / UX-as-output patterns for bidirectional PRD <-> UX flow
- SKILL.md Discovery Posture: push for two to three named-persona UJs in non-trivial scope

Validation checklist:
- Q-3 Traceability tightened to require Realizes UJ-X on FRs and Validates FR-X on SMs
- Q-7 (new): FR testability — every FR has at least one testable consequence
- S-1 Glossary integrity: now covers FR descriptions, consequences, UJ flows, SM definitions
- S-2: SM added to ID continuity scope
- S-5 (new): UJ persona linkage — every UJ names a persona by exact §2 label
- STK-2 (new): UJ density gate — non-hobby scope needs at least two UJs

* docs(bmad-prd): anonymize validation-findings JSON example

Replace project-specific values (Plantsona prd_name, frozen timestamp, §16 location, premium-conversion finding) with generic placeholder content. Swap the example finding to demonstrate Q-7 FR testability so it doubles as a primer on the new checklist item.

* feat(bmad-prd): reviewer pass redesign and consolidate facilitation

- finalize_reviewers TOML field replaces inline review lenses; entries
  follow the skill:/file:/plain-text prefix convention, resolved on-demand
  so reviewer data has zero context cost on runs that skip the pass.
- Subagent contract: reviewers write to {doc_workspace}/review-{slug}.md
  and return summary-only (verdict, top findings, file path); parent
  never holds full review text.
- Section-by-section walk-through UX at Finalize and Validate; user
  decides per finding whether to autofix, discuss, defer, or ignore.
- Finalize entry names the sequence in one sentence so users understand
  the polish-last order.
- Template philosophy moved from prd-template.md to SKILL.md PRD
  Discipline; template is now pure shape menu (preamble and Notes for
  facilitator stripped).
- facilitation-guide.md content folded into SKILL.md Discovery posture
  (story-shape UJ walk, four MVP types, state-inference-don't-quiz);
  guide file deleted.

* feat(bmad-prd): tighten SKILL.md, extract Reviewer Gate and Validate playbook

- SKILL.md: trim activation/posture/discovery bloat; sharpen Right-skill
  check; extract Reviewer Gate to its own section (dedup with Finalize
  step 3 and Validate intent).
- references/validate.md: rename from validation-render.md and expand to
  the full Validate intent playbook (orient, run gate, structural
  validator pipeline, render, close).
- references/probing.md: drop stale facilitation-guide.md reference.
- assets/prd-template.md: redesign §2.4 User Journeys with named-scene
  default shape, worked example, and scope dial.

* fix(bmad-prd): make Brain dump a hard first-move rule

Discovery was being skipped: the LLM treated the user's opening
message as the full picture and jumped to multiple-choice intake.
Strengthen the ordering so Brain dump always comes first for Create
and Update, before any questions or working-mode choices.

- Add explicit Discovery ordering at the section top.
- Rewrite Brain dump as a non-negotiable first move with an anti-
  pattern callout naming the exact failure mode.
- Add timing prefix to Working mode reinforcing the order.

* refactor(bmad-prd): aggressive trim and quality fixes from analysis

SKILL.md cut 49% (143 -> 84 lines); references/validate.md 35%;
references/headless.md 22%. Package-wide ~21% reduction.

Customization sweep:
- {finalize_reviewers} -> {workflow.finalize_reviewers} (was a silent
  override no-op)
- Add canonical ## Conventions block
- Rename decision-log.md -> .decision-log.md across SKILL, refs, schemas
- customize.toml: validation_checklist -> validation_checklist_template,
  output_dir -> prd_output_path, output_folder_name -> run_folder_pattern;
  lifecycle comments on external_sources / external_handoffs

New behavior:
- Activation step 4: explicit by-name greeting using {user_name},
  {communication_language} persisted for every turn (not just greeting)
- Right-skill scan on first message before brain dump
- Neutral defaults when config.yaml is missing; never block on it
- Headless: Detection section + per-intent Inputs section + 'partial'
  status semantics + Update conflict-override rationale
- Brownfield Update bootstraps .decision-log.md via subagent when absent
- Reviewer Gate findings-overwhelm fix: tiered surfacing
  (verdict -> critical/high -> medium/low rolled into tail)
- Discovery edge cases: conditional MVP question, persona/UJ push
  contextually triggered, working modes renamed as outcomes
  (Fast path / Coaching path)
- Subagent discipline: Finalize step 2 return-format contract,
  step 5 structure->prose ordering, explicit no-subagent fallback

Tests:
- scripts/tests/test_render_validation_html.py (17 passing, covers
  grade thresholds, category mapping, stats, score-bar rendering)

* refactor(bmad-prd): replace mechanical checklist+renderer with quality rubric and LLM-synthesized report

The structural checklist + Python renderer produced mechanical pass/warn/fail
reports that didn't speak to actual PRD quality, and additional reviewers
(adversarial) wrote separate review-*.md files that never made it into the
HTML. Replaces that pipeline with:

- A judgment rubric across seven PRD-quality dimensions (decision-readiness,
  substance over theater, strategic coherence, done-ness clarity, scope
  honesty, downstream usability, shape fit) that adapts to stakes and PRD
  shape. Rubric walker writes review-rubric.md with per-dimension verdicts.
- HTML skeleton with TEMPLATE_* placeholders the synthesis pass fills
  directly — no substitution engine, no Python.
- Synthesis pipeline in references/validate.md: parent reads every
  review-*.md, fills the skeleton, writes validation-report.html plus
  markdown twin, opens via webbrowser. Folds every reviewer's findings
  into one report; grade derives from rubric verdicts and severity counts.
- Drops scripts/render-validation-html.py and scripts/tests/ entirely.
- finalize_reviewers defaults to empty (adversarial removed from defaults —
  too brutal and frequently wrong against PRDs; teams can append in
  override TOML).
- Headless mode now writes both HTML and markdown; skips browser-open.

* refactor(bmad-prd): faster working-mode entry, elicitation discipline, drop probing.md

Discovery rewrite: Brain dump -> Stakes calibration -> Working mode -> mode-scoped
work. Users in a hurry reach the Fast/Coaching choice in two or three turns instead
of ten. Brain dump explicitly invites existing inputs (briefs, research,
transcripts, prior PRD draft, design docs) alongside verbal context.

Elicitation discipline made explicit: Discovery pulls the user's vision out, never
inserts the LLM's. UJs and phasing must be user-articulated, not strawman-proposed
for rubber-stamp.

Coaching path now offers entry-point choice: Vision+Features (capability-first),
Personas+Journeys (user-first), or let-me-suggest. Capability-thinkers walk
features directly.

Template framing in PRD Discipline: Essential Spine is the expected default,
Adapt-In Menu is conditional, and the LLM is authorized to invent sections when
concerns don't match any cluster. Concern scan beat in Discovery surfaces real
domain concerns without forcing a fixed shape.

Web grounding: light targeted use at load-bearing moments authorized; deep
research is suggested to the user via dedicated research skills, accepting
gracefully if declined.

references/probing.md deleted; its load-bearing content was either LLM-default
PM instincts or already covered by SKILL.md.

Misroute list now includes bmad-workflow-builder for agent/custom-agent signals.

* fix(bmad-prd): align opener with Fast path naming, normalize misroute list

* refactor(bmad-prd, bmad-product-brief): bring skills to parity, default-on web research

Cross-skill consistency fixes:
- Brief renames {workflow.output_dir} -> {workflow.brief_output_path} and
  {workflow.output_folder_name} -> {workflow.run_folder_pattern} to match PRD's
  naming pattern.
- Decision-log filename unified on .decision-log.md (dotfile convention) across
  both skills.
- Brief picks up PRD's fallback on customization-resolve failure (read TOML
  directly instead of halt).
- Brief picks up PRD's persistent_facts default that auto-loads
  project-context.md.
- Brief greeting now enforces {communication_language} for the entire run, not
  just the greeting.

PRD additions, propagated from brief:
- File-roles paragraph in Conventions (boundary rules for .decision-log.md vs
  addendum.md; capture during conversation, not at finalize; audit/override
  never goes in addendum).
- Greeting now tells the user they can invoke bmad-party-mode or
  bmad-advanced-elicitation at any point.
- Create intent now writes prd.md with status: draft and creates the
  .decision-log.md skeleton at workspace init.
- Resume-check on activation: scans prd_output_path for prior in-progress runs
  (status not final) and offers to resume.
- Finalize Close sets status: final + updated date so resume-check can
  distinguish finalized from in-progress.
- Stakes-calibrated length guidance in PRD Discipline.

Web research, default-on for any scope:
- Reframed external_sources lines in both skills to distinguish org-configured
  registry (internal tools) from generic web research; both fire on the same
  triggers.
- New Research subagents (default) beat in PRD Discovery: spawn web-research
  subagents to ground the picture; AI especially where training data ages by
  the week. Subagent searches; parent receives a digest. Deep work routes to
  bmad-market-research / bmad-domain-research / bmad-technical-research.
- Brief Discovery picks up the same posture in lighter form.

* fix(bmad-prd, bmad-product-brief): drop phantom v2 callout, add Fast/Coaching to brief

- Drop `[v2 — out of MVP]` from PRD validation rubric Dimension 5. It was
  flagged for absence but never instructed for use anywhere — the template uses
  `[NOTE FOR PM]` for v2/v3 deferrals, which is the de-facto convention.
- Add Fast path / Coaching path working-mode choice to brief Discovery so the
  "I'm pitching tomorrow" user has an express option. Note that the opener's
  pressure-calibration philosophy primarily shapes Coaching path; Fast path
  swaps pushback for [ASSUMPTION] tags the user can correct in review.

* refactor(bmad-prd): tighten Research subagents beat
2026-05-16 19:16:45 -05:00