Skip to content

fix(explore): guide planning with focused discovery questions - #1017

Open
DanRioDev wants to merge 3 commits into
Fission-AI:mainfrom
DanRioDev:improve-explore-questions
Open

fix(explore): guide planning with focused discovery questions#1017
DanRioDev wants to merge 3 commits into
Fission-AI:mainfrom
DanRioDev:improve-explore-questions

Conversation

@DanRioDev

@DanRioDev DanRioDev commented Apr 28, 2026

Copy link
Copy Markdown

Status

Ready for human review. Local verification passes. Linux, macOS, and Windows CI, Security, lint/type check, release tracking, and CodeRabbit have passed. No PR approval or merge has been submitted.

What was wrong

Explore could leave planning as an unguided conversation instead of helping the user resolve decisions. Issue #1064 describes this friction.

How it was fixed

One shared planning section now guides both the skill and slash command to inspect repository evidence before asking factual questions, resolve blocking decisions before dependent details, and ask one focused question at a time. Recommendations are conditional on evidence; user intent is never invented.

The guidance keeps proposed defaults separate from accepted decisions and lets the user pause, pivot, or defer. Freeform exploration, explicit write confirmation, store selection, project context, and artifact capture behavior remain intact.

The hardening preserves the original contributor commits, resolves conflicts against current main, updates the distributed Explore skill and three parity hashes, and retains the patch changeset.

Replication / proof

  • Six new contract tests failed before the change; all 22 Explore tests now pass.
  • Full suite: 4,235 tests across 145 files pass on Node 20.19.0.
  • Build, TypeScript check, ESLint, changeset status, and whitespace checks pass.
  • All 106 template tests pass; independent review separately passed 50 Explore/parity tests with no findings.
  • Real CLI smoke: init emits identical planning guidance to the Claude skill, Codex skill, and Claude command. Removing the section and running update --force restores all three exactly.

Notes

The first Windows run timed out after 10 seconds in the unchanged store test produces byte-identical store.yaml without --remote. A rerun passed on the exact same commit; no test limits or source files were changed.

Tests verify instruction contracts and generated content, not empirical model compliance. The original exhaustive interview and mandatory recommendation format were narrowed to avoid endless questioning and ambiguous consent.

The initial full run had six environment-related failures. Isolating global tool directories, using a standalone Node binary outside the npx cache, and clearing inherited shell-completion settings resolved them without repository changes. The completion failures were independently reproduced on unchanged main.

Thanks @DanRioDev for the original contribution and direction.

Closes #1064

Copilot AI review requested due to automatic review settings April 28, 2026 01:03
@DanRioDev
DanRioDev requested a review from TabishB as a code owner April 28, 2026 01:03
@coderabbitai

coderabbitai Bot commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e4b3605f-920d-4465-aa5f-afab78ae0d6e

📥 Commits

Reviewing files that changed from the base of the PR and between a0ddb60 and 2d7af72.

📒 Files selected for processing (5)
  • .changeset/curious-explore-questions.md
  • skills/openspec-explore/SKILL.md
  • src/core/templates/workflows/explore.ts
  • test/core/templates/explore.test.ts
  • test/core/templates/skill-templates-parity.test.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • .changeset/curious-explore-questions.md
  • test/core/templates/skill-templates-parity.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

This PR adds planning guidance to explore mode. The guidance uses repository evidence, dependency-ordered questions, focused prompts, grounded recommendations, conversational decision tracking, and separate write authorization. Tests, parity hashes, and a patch changeset are updated.

Changes

Explore planning guidance

Layer / File(s) Summary
Planning guidance and template wiring
src/core/templates/workflows/explore.ts, skills/openspec-explore/SKILL.md
Adds shared planning guidance to both explore template outputs. Documents focused questions, repository checks, dependency ordering, recommendations, decision tracking, and stopping criteria.
Guidance parity and release validation
test/core/templates/explore.test.ts, test/core/templates/skill-templates-parity.test.ts, .changeset/curious-explore-questions.md
Adds regression and parity tests. Updates expected template hashes and records a patch release for @fission-ai/openspec.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 2d7af

The PR is merge-ready after normal checks and review; no actionable merge-blocking risk remains. A non-blocking follow-up is to explicitly include openspec/AGENTS.md in the planning scan so project-specific guidance is less likely to be missed.

Suggested reviewers: tabishb, clay-good

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. (2 skipped: 2 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes address issue [#1064] by adding proactive, focused discovery questions, dependency-ordered decisions, and planning guidance to the explore skill and command templates. Tests verify the upd…
Out of Scope Changes check ✅ Passed All changes support the linked objective. The template guidance, generated skill update, parity hashes, regression tests, and patch changeset are related implementation and validation work.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: improving explore-mode planning with focused discovery questions.
Full details: Linked Issues check

Explanation

The changes address issue [#1064] by adding proactive, focused discovery questions, dependency-ordered decisions, and planning guidance to the explore skill and command templates. Tests verify the updated behavior.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ 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
Contributor

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/core/templates/workflows/explore.ts (1)

17-113: Extract shared explore-policy text to a single source to prevent drift.

The same long guidance is maintained twice (instructions and slash-command content). This is likely to drift and forces repetitive hash-baseline churn for text-only edits.

Also applies to: 450-553

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

In `@src/core/templates/workflows/explore.ts` around lines 17 - 113, The file
duplicates the long "explore" guidance in two places (the instructions block and
the slash-command `content`) which will drift; extract the shared text into a
single exported constant (e.g., EXPLORE_POLICY_TEXT or explorePolicyText) and
replace the inline literals used by `instructions` and the slash-command
`content` with references to that constant; update any imports/usages in the
same module (and the other occurrence around lines 450-553) so both places read
the single source, and add a short unit or snapshot check if the project uses
text-baseline tests to prevent regressions.
🤖 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/core/templates/workflows/explore.ts`:
- Around line 38-44: Add "@/openspec/AGENTS.md" to the mandatory pre-question
context scan used by the explore workflow: update the list/constant that defines
required contexts (e.g., MANDATORY_PRE_QUESTION_CONTEXTS or
PRE_QUESTION_CHECKLIST) in the explore template in
src/core/templates/workflows/explore.ts so that any request mentioning
planning/proposals/spec/change/plan triggers loading/opening openspec/AGENTS.md
before prompting the user; ensure the path is included in the same scanning
order as other repo-authoritative files and adjust any helper that builds the
pre-question context bundle (e.g., collectPreQuestionContexts) to include it.

---

Nitpick comments:
In `@src/core/templates/workflows/explore.ts`:
- Around line 17-113: The file duplicates the long "explore" guidance in two
places (the instructions block and the slash-command `content`) which will
drift; extract the shared text into a single exported constant (e.g.,
EXPLORE_POLICY_TEXT or explorePolicyText) and replace the inline literals used
by `instructions` and the slash-command `content` with references to that
constant; update any imports/usages in the same module (and the other occurrence
around lines 450-553) so both places read the single source, and add a short
unit or snapshot check if the project uses text-baseline tests to prevent
regressions.
🪄 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: 9058fa01-5adc-4502-933b-60fbc57181f3

📥 Commits

Reviewing files that changed from the base of the PR and between 3c7a05c and d55854e.

📒 Files selected for processing (3)
  • .changeset/curious-explore-questions.md
  • src/core/templates/workflows/explore.ts
  • test/core/templates/skill-templates-parity.test.ts

Comment thread src/core/templates/workflows/explore.ts Outdated
Comment on lines +38 to +44
Before asking the user, check whether the answer is available from:

- Existing OpenSpec changes, specs, proposals, designs, or tasks
- Source code, tests, docs, configs, package metadata, or recent conventions
- Existing architecture, naming, integration, UX, or API patterns

Do not ask repository-answerable questions. Explore first, then state what you found.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Include openspec/AGENTS.md in the mandatory pre-question context scan.

The new “repository-answerable” checklist omits openspec/AGENTS.md, which is the authoritative source for proposal/spec conventions during planning conversations.

Suggested patch
 Before asking the user, check whether the answer is available from:
 
+- openspec/AGENTS.md for proposal/spec conventions and project guidance
 - Existing OpenSpec changes, specs, proposals, designs, or tasks
 - Source code, tests, docs, configs, package metadata, or recent conventions
 - Existing architecture, naming, integration, UX, or API patterns

Based on learnings: Always open @/openspec/AGENTS.md when the request mentions planning/proposals/spec/change/plan so exploration follows authoritative project conventions.

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

In `@src/core/templates/workflows/explore.ts` around lines 38 - 44, Add
"@/openspec/AGENTS.md" to the mandatory pre-question context scan used by the
explore workflow: update the list/constant that defines required contexts (e.g.,
MANDATORY_PRE_QUESTION_CONTEXTS or PRE_QUESTION_CHECKLIST) in the explore
template in src/core/templates/workflows/explore.ts so that any request
mentioning planning/proposals/spec/change/plan triggers loading/opening
openspec/AGENTS.md before prompting the user; ensure the path is included in the
same scanning order as other repo-authoritative files and adjust any helper that
builds the pre-question context bundle (e.g., collectPreQuestionContexts) to
include it.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the Explore workflow templates to guide users through more dependency-aware discovery when planning changes, while keeping Explore as a non-implementation mode.

Changes:

  • Added “Relentless Interview Mode” guidance (decision-tree order, recommended defaults, one-question-at-a-time format, and “explore repo first” direction).
  • Updated example dialogues and optional summary structure to reflect the new questioning approach.
  • Refreshed template parity hashes and added a patch changeset for the package release.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/core/templates/workflows/explore.ts Updates Explore skill + /opsx:explore command prompt content to drive structured discovery and repo-first questioning.
test/core/templates/skill-templates-parity.test.ts Updates expected hashes for modified Explore templates and generated content.
.changeset/curious-explore-questions.md Adds a patch changeset describing the Explore guidance improvements.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/core/templates/workflows/explore.ts Outdated

- Follow a script
- Ask the same questions every time
- Use a fixed questionnaire, but do maintain a live question tree for this specific problem
Comment thread src/core/templates/workflows/explore.ts Outdated
Comment on lines +241 to +263

Why this matters: this determines whether we need CRDTs,
locking, or simple realtime events.

Comment on lines 668 to 672

- Follow a script
- Ask the same questions every time
- Use a fixed questionnaire, but do maintain a live question tree for this specific problem
- Produce a specific artifact
@clay-good
clay-good requested a review from a team as a code owner August 27, 2026 21:20
@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@clay-good clay-good changed the title feat: improve explore discovery questions fix(explore): guide planning with focused discovery questions Aug 27, 2026

@alfred-openspec alfred-openspec left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed at 2d7af72. The planning guidance is focused and evidence-first without forcing an interview or weakening Explore and write-confirmation boundaries. Build and all 48 focused template and parity tests pass.

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.

opsx:explore in codex does not actively raise decision prompts

4 participants