Skip to content

feat(elicitation): fall back to built-in methods when catalog is unavailable - #2605

Closed
devilliersdutoit wants to merge 3 commits into
bmad-code-org:mainfrom
devilliersdutoit:feat/elicitation-catalog-fallback
Closed

feat(elicitation): fall back to built-in methods when catalog is unavailable#2605
devilliersdutoit wants to merge 3 commits into
bmad-code-org:mainfrom
devilliersdutoit:feat/elicitation-catalog-fallback

Conversation

@devilliersdutoit

Copy link
Copy Markdown
Contributor

What

Serving the Catalog documents no behavior for a failed pick_methods.py call, so the skill can stall at the exact moment it is meant to help. This adds a fallback: use well-known methods from built-in knowledge and keep going.

Rebuilt against the post-#2603 structure. Replaces #2534, which targeted the old Step 1 / FLOW layout and is now unmergeable.

Why

Maintainer feedback on the earlier #2517: "it might be better for the agent to invent and still perform the AE instead of failing." This follows that, and mirrors the persona path in Running a Method, which already invents viewpoints when no agent fits.

Fixes #2516

How

  • One paragraph in Serving the Catalog, covering the three real failure modes verified against pick_methods.py:
    • missing methods file exits 2
    • header-only catalog returns no rows (categories exits 0 with empty output)
    • mis-shaped file yields blank method_name/description rows at exit 0
  • Menu contract stays intact — reshuffle and [a] draw from the same built-in set, so no downstream step is left referencing a catalog that isn't there.
  • {workflow.preferences} still honored; {workflow.additional_methods} used if readable.

Testing

Exercised pick_methods.py against missing, header-only, and malformed catalogs to confirm the exit codes and output shapes above. Docs-only change, no script edits. npm run validate:refs shows one broken reference, pre-existing on main in full-scan-instructions.md and unrelated to this change.

…ailable

Serving the Catalog documented no behavior for a failed pick_methods.py
call, so the skill could stall at the point it is meant to help. Three
failure modes exist today: a missing methods file exits 2, a header-only
catalog returns no rows, and a mis-shaped file yields blank rows at
exit 0.

Fall back to well-known methods from built-in knowledge, keeping the
menu contract (including reshuffle and [a]) intact. Mirrors the existing
persona path, which already invents viewpoints when none resolve.

Replaces bmad-code-org#2534, which targeted the pre-bmad-code-org#2603 file structure.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The elicitation skill now falls back to built-in methods when the methods catalog is unreadable or contains no valid rows, while preserving preferences and only including additional methods when readable.

Changes

Elicitation fallback behavior

Layer / File(s) Summary
Catalog availability fallback
src/core-skills/bmad-advanced-elicitation/SKILL.md
Defines catalog failure conditions, a one-time notice, built-in methods for menu operations, preference handling, and conditional additional-method availability.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

Suggested reviewers: bmadcode

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR implements a fallback to invented methods, but #2516 պահանջed a fail-fast halt with a clear error. Change the skill to halt with a clear error when the registry is missing, empty, or malformed, and do not invent methods.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: using built-in methods when the catalog is unavailable.
Description check ✅ Passed The description is directly related to the catalog-fallback behavior described in the changeset.
Out of Scope Changes check ✅ Passed The edits stay within the elicitation catalog behavior and do not add unrelated scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/core-skills/bmad-advanced-elicitation/SKILL.md`:
- Around line 37-38: Update the catalog-unavailable fallback in SKILL.md so
readable {workflow.additional_methods} entries are still loaded and treated as
available even when the base catalog is missing or unreadable. Ensure the
instructions do not promise or silently drop those custom methods, while
preserving the built-in-method fallback and unchanged menu behavior.
- Around line 37-38: Update the catalog availability handling in the “If the
catalog is unavailable” guidance to distinguish catalog-load errors from valid
no-match exits: do not trigger built-in fallback solely on any non-zero command
status when running random or show operations. Detect fallback only for actual
catalog read/parse failures, or explicitly validate the command’s error
type/output before declaring the catalog unavailable; preserve normal no-match
behavior and the existing built-in fallback flow for genuine catalog failures.
- Around line 37-38: The advanced elicitation documentation in
advanced-elicitation.md and bmad-developer-guide.md must describe the
catalog-unavailable fallback: continue with built-in methods, announce this
once, preserve the menu, use the same built-in set for reshuffling and [a], and
include workflow.additional_methods when readable. Update both documents while
retaining the existing generic menu flow and preference handling.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4541561f-8413-4145-934d-7339691a05b5

📥 Commits

Reviewing files that changed from the base of the PR and between c23f234 and 0f3f378.

📒 Files selected for processing (1)
  • src/core-skills/bmad-advanced-elicitation/SKILL.md

Comment on lines +37 to +38
**If the catalog is unavailable:** do not halt — a refinement pass is worth more than none. Treat the catalog as unavailable when a command exits non-zero (a missing methods file exits 2), or when it yields no usable rows: empty output, or rows with blank `method_name`/`description` because the file is not in the expected `num,category,method_name,description,output_pattern` shape. Fall back to well-known elicitation methods from your own knowledge, drawing on the same categories you would have picked for the target — risk (Pre-Mortem, Red Team vs Blue Team), technical (First Principles, Tree of Thoughts), collaboration (Stakeholder Round Table), creative (Critique and Refine). Say once that the catalog was unavailable so built-in methods are in use, then serve the menu unchanged; reshuffle and [a] draw from that same built-in set. Honor `{workflow.preferences}` as usual, and treat `{workflow.additional_methods}` entries as available if you were able to read them.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Do not promise additional methods when the base catalog is missing.

pick_methods.py checks args.file.is_file() before processing --extra, so a missing base catalog exits with code 2 and never loads readable {workflow.additional_methods}. Either make the fallback load additional methods independently or revise this contract so custom methods are not silently dropped.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/core-skills/bmad-advanced-elicitation/SKILL.md` around lines 37 - 38,
Update the catalog-unavailable fallback in SKILL.md so readable
{workflow.additional_methods} entries are still loaded and treated as available
even when the base catalog is missing or unreadable. Ensure the instructions do
not promise or silently drop those custom methods, while preserving the
built-in-method fallback and unchanged menu behavior.

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Distinguish catalog failures from expected no-match exits.

The CLI returns non-zero for valid no-result cases: random returns 1 when exclusions empty the pool, and show returns 1 when a requested method is absent. Treating every non-zero exit as catalog failure can switch to built-ins during normal operation. Restrict fallback detection to catalog-load errors or explicitly validate the command output/error type.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/core-skills/bmad-advanced-elicitation/SKILL.md` around lines 37 - 38,
Update the catalog availability handling in the “If the catalog is unavailable”
guidance to distinguish catalog-load errors from valid no-match exits: do not
trigger built-in fallback solely on any non-zero command status when running
random or show operations. Detect fallback only for actual catalog read/parse
failures, or explicitly validate the command’s error type/output before
declaring the catalog unavailable; preserve normal no-match behavior and the
existing built-in fallback flow for genuine catalog failures.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

if [ -d docs ]; then
  rg -n -i \
    'advanced elicitation|pick_methods|methods\.csv|additional_methods|reshuffle|list all' \
    docs || true
else
  echo "No docs/ directory found."
fi

Repository: bmad-code-org/BMAD-METHOD

Length of output: 1341


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== SKILL.md excerpt ==\n'
sed -n '1,120p' src/core-skills/bmad-advanced-elicitation/SKILL.md

printf '\n== docs/explanation/advanced-elicitation.md ==\n'
sed -n '1,220p' docs/explanation/advanced-elicitation.md

printf '\n== docs/explanation/checkpoint-preview.md ==\n'
sed -n '1,160p' docs/explanation/checkpoint-preview.md

printf '\n== docs/vi-vn/bmad-developer-guide.md excerpt ==\n'
sed -n '640,710p' docs/vi-vn/bmad-developer-guide.md

Repository: bmad-code-org/BMAD-METHOD

Length of output: 18080


Update the advanced elicitation docs
docs/explanation/advanced-elicitation.md and docs/vi-vn/bmad-developer-guide.md still describe the generic menu flow only. Add the catalog-unavailable fallback, and note that [a]/reshuffle use the built-in method set and that {workflow.additional_methods} are included when available.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/core-skills/bmad-advanced-elicitation/SKILL.md` around lines 37 - 38, The
advanced elicitation documentation in advanced-elicitation.md and
bmad-developer-guide.md must describe the catalog-unavailable fallback: continue
with built-in methods, announce this once, preserve the menu, use the same
built-in set for reshuffling and [a], and include workflow.additional_methods
when readable. Update both documents while retaining the existing generic menu
flow and preference handling.

Source: Path instructions

@devilliersdutoit

Copy link
Copy Markdown
Contributor Author

Closing this — withdrawing the change for now.

@devilliersdutoit
devilliersdutoit deleted the feat/elicitation-catalog-fallback branch July 25, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: fall back to built-in methods when the elicitation registry is missing or malformed

1 participant