Skip to content

refactor(quick-dev): replace unconditional artifact scan with intent cascade#2105

Merged
alexeyv merged 1 commit intomainfrom
refactor/step1-intent-cascade
Mar 23, 2026
Merged

refactor(quick-dev): replace unconditional artifact scan with intent cascade#2105
alexeyv merged 1 commit intomainfrom
refactor/step1-intent-cascade

Conversation

@alexeyv
Copy link
Copy Markdown
Collaborator

@alexeyv alexeyv commented Mar 23, 2026

Summary

quick-devs step-01 used to run a full artifact scan on every invocation -- listing active specs and halting for input even when the user already said what they want. This adds an intent check that short-circuits that scan:

  1. Explicit argument -- user passed a file or instruction. Use it directly. Only EARLY EXITs for files that match the tech-spec template shape (proper status frontmatter). Everything else is treated as starting intent.
  2. Recent conversation -- last few messages make intent obvious. Use that.
  3. Artifact scan -- nothing clear. Run the original scan with all existing behaviors (wipFile, active spec listing, unformatted file suggestion).

The scan still exists and works the same way -- it just doesnt fire when its not needed.

Test plan

  • /bmad-quick-dev intent-foo.md -- resolves from argument, no scan prompt
  • /bmad-quick-dev spec-something.md (with status: ready-for-dev) -- EARLY EXITs to step-03
  • /bmad-quick-dev after discussing a spec in conversation -- resolves from context
  • /bmad-quick-dev cold, no context -- falls through to full artifact scan as before
  • /bmad-quick-dev random-doc.md (no status frontmatter) -- treated as starting intent, not routed

@augmentcode
Copy link
Copy Markdown

augmentcode bot commented Mar 23, 2026

🤖 Augment PR Summary

Summary: Refactors bmad-quick-dev Step 1 routing by replacing an unconditional artifact scan with a 3-tier intent cascade (argument → conversation context → interactive scan).
Why: Reduces unnecessary prompting/scanning when intent is already clear while preserving the existing interactive scan behavior as a fallback.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

### Tier 1: Explicit argument

The workflow was invoked with a file path, spec name, or clear directive as an argument. If that alone identifies the target unambiguously:
- If the argument names a `ready-for-dev` or `in-progress` spec: Set `spec_file`. **EARLY EXIT** → `./step-03-implement.md`
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Tier 1 routing is based on whether a spec is ready-for-dev/in-progress/in-review, which typically requires reading the spec frontmatter. Consider stating explicitly that the spec file’s status must be verified (not inferred from the argument text) before choosing the EARLY EXIT target.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.


### Tier 2: Preceding conversation context

No explicit argument, but the human turns before invocation contain a decision (e.g. "let's do X", discussion of a specific spec). If context alone resolves intent unambiguously, apply the same routing logic as Tier 1. Intent resolved — skip to INSTRUCTIONS.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Tier 2 ends with “Intent resolved — skip to INSTRUCTIONS,” which could be read as continuing even when context indicates an in-review or ready-for-dev spec. Consider making the Tier 1-style EARLY EXIT routing explicit here as well to reduce the risk of misrouting.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 23, 2026

📝 Walkthrough

Walkthrough

Documentation update to the step-01 routing workflow, replacing an artifact-scan approach with an intent-cascade framework using tiered short-circuit evaluation. Routing now resolves through explicit arguments, preceding context, or artifact scan, with earlier tiers preventing later interactive gating prompts.

Changes

Cohort / File(s) Summary
Routing Logic Documentation
src/bmm-skills/4-implementation/bmad-quick-dev/step-01-clarify-and-route.md
Replaced artifact-scan routing with intent-cascade using three tiered resolution tiers (explicit argument, conversation context, artifact scan). Updated control flow to skip interactive gating prompts when earlier tiers resolve intent unambiguously. Refined Tier 3 artifact-interaction behavior for interactive resume/archive or spec selection.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: replacing an unconditional artifact scan with a tiered intent cascade routing mechanism in the quick-dev workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description clearly explains the intent cascade feature, its three tiers, the rationale (avoiding unnecessary artifact scans), and provides specific test cases aligned with the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/step1-intent-cascade

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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/bmm-skills/4-implementation/bmad-quick-dev/step-01-clarify-and-route.md (1)

31-31: Clarify Tier 2 control flow to avoid contradictory execution.

Line 31 says “apply Tier 1 routing logic” and also “skip to INSTRUCTIONS.” For context that identifies an in-review or ready-for-dev spec, that second clause conflicts with Tier 1 early exits. Tighten wording so “skip to INSTRUCTIONS” applies only to new-work/intent cases.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/bmm-skills/4-implementation/bmad-quick-dev/step-01-clarify-and-route.md`
at line 31, The Tier 2 paragraph referencing "apply Tier 1 routing logic" and
"skip to INSTRUCTIONS" is ambiguous; update the sentence so that Tier 1's
early-exit routing (the Tier 1 routing logic) is always honored for contexts
that resolve to existing-spec states like "in-review" or "ready-for-dev", and
make "skip to INSTRUCTIONS" explicitly apply only when the context represents a
new-work/intent decision (i.e., an explicit new intent such as "let's do X");
ensure the wording names the states "in-review" and "ready-for-dev" and
references INSTRUCTIONS and Tier 1 routing logic so readers know when to take
the early-exit vs when to proceed directly to INSTRUCTIONS.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/bmm-skills/4-implementation/bmad-quick-dev/step-01-clarify-and-route.md`:
- Around line 20-27: When Tier 1 or Tier 2 resolves the intent as "new work"
(the branches described in the Tier 1 bullets and the similar Tier 2 branch),
add a non-routing safety check that detects an existing {wipFile} and pauses the
early-exit: if {wipFile} exists, present the resume/archive choice (or
auto-archive) before proceeding to ingest new intent and before skipping Tier 3;
ensure this check lives immediately after the "new work" resolution in the
resolution logic so step-03/step-04 early exits only occur after the {wipFile}
decision is handled.

---

Nitpick comments:
In `@src/bmm-skills/4-implementation/bmad-quick-dev/step-01-clarify-and-route.md`:
- Line 31: The Tier 2 paragraph referencing "apply Tier 1 routing logic" and
"skip to INSTRUCTIONS" is ambiguous; update the sentence so that Tier 1's
early-exit routing (the Tier 1 routing logic) is always honored for contexts
that resolve to existing-spec states like "in-review" or "ready-for-dev", and
make "skip to INSTRUCTIONS" explicitly apply only when the context represents a
new-work/intent decision (i.e., an explicit new intent such as "let's do X");
ensure the wording names the states "in-review" and "ready-for-dev" and
references INSTRUCTIONS and Tier 1 routing logic so readers know when to take
the early-exit vs when to proceed directly to INSTRUCTIONS.
🪄 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: 4f0864b7-9302-48d4-ba3c-079ba4c8e309

📥 Commits

Reviewing files that changed from the base of the PR and between 980d290 and 0bf0d86.

📒 Files selected for processing (1)
  • src/bmm-skills/4-implementation/bmad-quick-dev/step-01-clarify-and-route.md

Comment on lines +20 to +27
Resolve intent using short-circuit evaluation — walk tiers in order, stop as soon as intent is unambiguous. Later tiers may still enrich understanding (e.g. artifact status confirms routing), but must not gate with interactive prompts once an earlier tier resolved the target.

### Tier 1: Explicit argument

The workflow was invoked with a file path, spec name, or clear directive as an argument. If that alone identifies the target unambiguously:
- If the argument names a `ready-for-dev` or `in-progress` spec: Set `spec_file`. **EARLY EXIT** → `./step-03-implement.md`
- If the argument names an `in-review` spec: Set `spec_file`. **EARLY EXIT** → `./step-04-review.md`
- If the argument names an intent file or describes new work: Ingest it as the starting intent. Intent resolved — skip to INSTRUCTIONS.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Potential WIP data loss when Tier 1/2 resolves “new work”.

If intent resolves in Line 20/Line 27/Line 31 as “new work,” Tier 3 is skipped, so existing {wipFile} is never offered for resume/archive. Step 2 then writes to {wipFile}, which can clobber unfinished work.

Suggested guard (non-routing safety check)
 Resolve intent using short-circuit evaluation — walk tiers in order, stop as soon as intent is unambiguous. Later tiers may still enrich understanding (e.g. artifact status confirms routing), but must not gate with interactive prompts once an earlier tier resolved the target.
+Exception: if resolved target is "new work" and `{wipFile}` exists, run a safety prompt (`[R] Resume` | `[A] Archive and continue`) before proceeding to INSTRUCTIONS.

Also applies to: 31-31

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/bmm-skills/4-implementation/bmad-quick-dev/step-01-clarify-and-route.md`
around lines 20 - 27, When Tier 1 or Tier 2 resolves the intent as "new work"
(the branches described in the Tier 1 bullets and the similar Tier 2 branch),
add a non-routing safety check that detects an existing {wipFile} and pauses the
early-exit: if {wipFile} exists, present the resume/archive choice (or
auto-archive) before proceeding to ingest new intent and before skipping Tier 3;
ensure this check lives immediately after the "new work" resolution in the
resolution logic so step-03/step-04 early exits only occur after the {wipFile}
decision is handled.

@alexeyv alexeyv force-pushed the refactor/step1-intent-cascade branch 4 times, most recently from 0a0f75c to 9b2695f Compare March 23, 2026 02:57
…cascade

Short-circuit evaluation in step-01: explicit argument → conversation
context → full artifact scan. Stops prompting as soon as intent is
unambiguous. All existing scan behaviors preserved in tier 3.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@alexeyv alexeyv force-pushed the refactor/step1-intent-cascade branch from 9b2695f to 0504506 Compare March 23, 2026 03:09
@alexeyv alexeyv merged commit ac5cb9d into main Mar 23, 2026
5 checks passed
@alexeyv alexeyv deleted the refactor/step1-intent-cascade branch March 23, 2026 04:43
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.

1 participant