Skip to content

feat(domain): add prototype exploration mode for iterative visual prototyping#513

Open
arielshad wants to merge 38 commits intomainfrom
feat/prototype-exploration-mode
Open

feat(domain): add prototype exploration mode for iterative visual prototyping#513
arielshad wants to merge 38 commits intomainfrom
feat/prototype-exploration-mode

Conversation

@arielshad
Copy link
Copy Markdown
Contributor

Summary

Adds a new Exploration mode alongside Regular and Fast modes, enabling a discovery-first workflow where users describe a vague idea, see quick disposable prototypes, iterate with feedback, and promote to a full feature once direction is clear.

Key changes

  • FeatureMode enum replaces boolean fast field — New TypeSpec FeatureMode enum (Regular, Fast, Exploration) replaces the boolean fast field on the Feature entity. All code paths migrated from boolean checks to enum comparisons across domain, persistence, and presentation layers.

  • Exploring lifecycle state — New Exploring state added to SdlcLifecycle enum with lifecycle gates defining valid transitions: Exploring → Implementation (promote to fast), Exploring → Requirements (promote to regular), Exploring → Deleting (discard), and self-loop for iterations.

  • Exploration agent graph — New LangGraph graph factory (createExplorationAgentGraph) with topology: START → prototype-generate → interrupt(feedback) → apply-feedback → prototype-generate → ... → END. Supports iterative prototyping with full context preservation across feedback cycles.

  • Web UI mode selector — Three-way mode selector (Regular / Fast / Explore) with ClipboardList, Zap, and FlaskConical icons replaces the old fast-mode toggle in the feature create drawer. Approval gates are conditionally hidden when Explore mode is selected.

  • Prototype review tab — New PrototypeTab component in the feature drawer showing iteration count, feedback status, text feedback input, and promote/discard actions for exploration features.

  • Canvas visual treatment — Exploration features render with distinct amber/yellow color scheme and beaker/flask icon on the canvas, visually distinguishing them from regular and fast features.

  • CLI commands — New --explore flag on shep feat new, plus shep feat feedback <id> <text> and shep feat promote <id> [--fast] commands for CLI-based exploration workflow.

  • Settings integrationworkflow.defaultMode setting (Regular/Fast/Exploration) replaces the old boolean defaultFastMode, with explorationMaxIterations setting for configuring the feedback loop limit.

  • Promote & Discard use casesPromoteExplorationUseCase transitions exploration features to Regular or Fast mode with in-place mode transition. Discard reuses existing feature deletion infrastructure.

Evidence

Application Screenshots

Screenshot Description
Dashboard Canvas Dashboard canvas with repository nodes and feature cards in various lifecycle states
Mode Selector Feature create drawer with three-way mode selector (Regular / Fast / Explore)
Explore Selected Explore mode selected — approval gates correctly hidden
Settings Page Settings page with Language, Agent, and Environment sections
Settings Workflow Workflow settings with new 'Default feature mode' dropdown replacing boolean toggle

Storybook Stories

Screenshot Description
ModeSelector Stories ModeSelector component with Regular, Fast, and Explore toggle options
PrototypeTab First PrototypeTab at first iteration with feedback input and promote/discard actions
PrototypeTab Mid PrototypeTab at iteration 5 showing continued feedback capability
FeatureNode Colors FeatureNode highlight color exploration with 10 palette options

Test Results

  • 5459 unit tests passing across 383 test files — zero regressions
  • 281 exploration-specific tests across 12 test files covering: FeatureMode enum, lifecycle gates, feature mapper, create/delete/promote use cases, exploration agent graph, prototype-generate node, apply-feedback node, agent state channels, worker arg parsing, and worker routing
  • 234 UI and CLI tests across 9 test files covering: feedback/prototype prompt builders, settings defaults, promote/feedback CLI commands, derive-feature-state, create-feature web action, feature drawer tabs, and feature create drawer with mode selector

Test plan

  • All 5459 unit tests pass with zero failures
  • Build compiles with zero TypeScript errors
  • Linter passes with zero warnings
  • TypeSpec compiles successfully with new FeatureMode enum and Exploring lifecycle state
  • Existing fast-mode functionality preserved after boolean-to-enum migration
  • All new UI components have colocated Storybook stories
  • Feature create drawer correctly shows/hides approval gates based on mode selection
  • Settings page shows new defaultMode dropdown replacing boolean toggle

Built with Shep 🐑 Shep Bot

@arielshad arielshad force-pushed the feat/prototype-exploration-mode branch 2 times, most recently from 9640597 to 053b00c Compare April 3, 2026 09:03
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 3, 2026

Dev Release Published

Artifact Version Install
npm 1.165.0-pr513.2621e83 npm install -g @shepai/cli@1.165.0-pr513.2621e83

Published from commit aaf4a89 | View CI

@arielshad arielshad force-pushed the feat/prototype-exploration-mode branch from aaf4a89 to 29957d6 Compare April 3, 2026 12:29
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 3, 2026

Dev Release Published

Artifact Version Install
npm 1.166.0-pr513.7e8c227 npm install -g @shepai/cli@1.166.0-pr513.7e8c227

Published from commit 29957d6 | View CI

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 3, 2026

Dev Release Published

Artifact Version Install
npm 1.166.0-pr513.fdcdd56 npm install -g @shepai/cli@1.166.0-pr513.fdcdd56

Published from commit a5dcc26 | View CI

arielshad and others added 24 commits April 5, 2026 15:14
…tion mode

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
15 architectural decisions covering FeatureMode enum, database migration,
exploration graph topology, feedback loop mechanism, state channels, worker
routing, web UI mode selector, canvas treatment, drawer tabs, promotion,
CLI commands, settings, spec initialization, and node implementation strategy.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace the boolean `fast` field on the Feature entity with a
FeatureMode enum (Regular, Fast, Exploration). This prevents invalid
state combinations and scales cleanly to future workflow modes.

Migration touches all layers: TypeSpec definition, generated output,
feature mapper, use cases, worker routing, CLI commands, Web UI
components, and all associated tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add Exploring to the SdlcLifecycle enum for the exploration/prototyping
mode. Valid transitions: Exploring to Implementation (promote-fast),
Exploring to Requirements (promote-regular), Exploring to Deleting
(discard), plus self-loop for feedback iterations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add iterationCount (int32, default 0) and maxIterations (optional int32)
fields to the Feature entity for tracking exploration feedback loop
progress. Update mapper, use cases, and all test fixtures.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Define EXPLORING_TRANSITIONS set with valid transitions from the
Exploring state: Implementation (promote-fast), Requirements
(promote-regular), and Deleting (discard). Exploring has no approval
gates since exploration bypasses SDLC.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add SQLite migration 051 that replaces the boolean fast column with a
TEXT mode column on the features table, supporting Regular, Fast, and
Exploration values. Also adds iteration_count and max_iterations columns
for exploration feedback loop tracking. Updates repository SQL to use
mode/iteration columns instead of fast.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add iterationCount, maxIterations, feedbackHistory (accumulating), and
explorationStatus channels to FeatureAgentAnnotation for exploration mode
feedback loop tracking. Follows the CI fix channels pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add buildPrototypeGeneratePrompt for exploration mode prototype generation
with feedback history context, and buildApplyFeedbackContext for state
transformation between iterations. Includes feedback summarization for
older entries beyond the recent 3.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…odes

Add prototype-generate node that calls the agent executor with exploration
prompts and interrupts for user feedback after each iteration. Add
apply-feedback node as a pure state transformation that appends feedback
to history and prepares context for the next iteration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Create createExplorationAgentGraph() factory with topology:
START -> prototype-generate -> interrupt -> apply-feedback -> loop.
Routes to END on promote/discard actions. Handles resume from interrupt
by detecting _approvalAction and returning early before re-executing
the agent, following the same pattern as executeNode() completedPhases.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ontext

Update worker graph selection to route mode=Exploration to the
exploration agent graph factory. Add prototype-generate node mapping
to Exploring lifecycle state. Add exploration timeout mapping in
node-helpers stage timeout keys.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add exploration mode handling to CreateFeatureUseCase: sets initial
lifecycle to Exploring, passes 'exploration' to spec initializer, and
forwards mode=Exploration to worker spawn options. Update
ISpecInitializerService interface to accept 'exploration' mode.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Extend spec initializer to accept mode='exploration' which creates only
feature.yaml (no spec, research, plan, or tasks YAMLs). Matches the
lightweight exploration philosophy where SDLC spec artifacts are not
needed until promotion.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Create PromoteExplorationUseCase that transitions an exploration feature
to Regular or Fast mode via in-place mode change. Validates feature is
in Exploration mode and Exploring lifecycle, scaffolds missing spec
YAMLs for regular promotion, creates new agent run, and spawns the
appropriate graph. Register in DI container with string-token alias.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add checkpoint database cleanup during feature deletion to remove
LangGraph state files for discarded explorations. Add tests verifying
exploration features in Exploring lifecycle can be deleted with proper
lifecycle transition and agent cancellation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add --explore flag for creating exploration-mode features. The flag
is mutually exclusive with --fast (error if both specified). Mode
resolution: --explore → Exploration, --fast → Fast, --no-fast →
Regular, default → workflow settings. Add i18n keys for explore,
feedback, and promote commands.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add feedback command for iterating on exploration prototypes. The
command validates the feature is in exploration mode and sends
feedback via the existing reject/resume mechanism. Add promote
command for transitioning exploration features to Regular or Fast
mode via PromoteExplorationUseCase. Register both commands in the
feat command group.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace the binary fast/regular Switch toggle in the feature create
drawer with a ToggleGroup-based ModeSelector supporting Regular, Fast,
and Exploration modes. Approval gates are hidden entirely when
Exploration mode is selected since SDLC gates do not apply.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add 'exploring' to FeatureLifecyclePhase with amber color scheme and
FlaskConical icon. Update feature-node.tsx to render mode-aware badge
(FlaskConical for Exploration, Zap for Fast, ClipboardList for Regular).
Wire mode and iterationCount fields through to FeatureNodeData from
build-feature-node-data and build-graph-nodes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Create PrototypeTab component with feedback input, promote/discard
actions, and iteration count display. Add 'prototype' to FeatureTabKey
and wire into feature-drawer-tabs visibility logic — shown when
lifecycle is 'exploring', SDLC-specific tabs are hidden. Update
deriveInitialTab to auto-select prototype tab for exploring features.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… discard

Create three server actions: submitExplorationFeedback (resumes graph
with iterate payload via RejectAgentRunUseCase), promoteExploration
(calls PromoteExplorationUseCase for in-place mode transition), and
discardExploration (validates exploration mode then calls delete use
case). Wire all three into feature-drawer-client with toast feedback
and optimistic canvas updates.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
arielshad and others added 14 commits April 5, 2026 15:16
…n settings

Replace workflow.defaultFastMode boolean with workflow.defaultMode string
that accepts 'Regular', 'Fast', or 'Exploration'. This completes the
boolean-to-enum migration for settings, matching the FeatureMode enum
used on the Feature entity.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…edback limit

Add workflow.explorationMaxIterations optional setting (default: 10)
that controls the maximum feedback iterations in exploration mode.
The CreateFeatureUseCase reads this from settings and sets it on
the feature entity when creating exploration-mode features.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ntation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…mentation

Replace synthetic evidence with real captures from running application:
- App screenshots from dev server (dashboard, create drawer, settings)
- Storybook screenshots (mode selector, prototype tab, feature node)
- Real test output from pnpm test:unit (5459 tests passing)
- Real build output from pnpm build (zero errors)
- CLI help output from built binary
- TypeSpec generated types with annotations

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…mode

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…on mode

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… mode

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ory sql

The settings repository INSERT and UPDATE statements still referenced the
old default_fast_mode column which was dropped by migration 052. Update
all three SQL references to use the renamed default_mode column.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ad of fast

The E2E web test seedFeature functions still used the old `fast` column
name which was dropped by migration 051. Update all three test files to
use the new `mode` column with 'Regular' string value.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use primary color (bg-primary/text-primary-foreground) for the selected
toggle item instead of the subtle accent color, so clicking Explore (or
any mode) produces a clearly visible selected state.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…spec

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ation-mode

# Conflicts:
#	packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.ts
#	src/presentation/web/app/actions/get-workflow-defaults.ts
#	src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.stories.tsx
#	src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.tsx
#	tests/unit/application/use-cases/features/create-feature.use-case.test.ts
#	tests/unit/infrastructure/persistence/sqlite/mappers/settings.mapper.test.ts
#	tests/unit/presentation/web/actions/get-workflow-defaults.test.ts
#	tests/unit/presentation/web/components/common/feature-create-drawer/feature-create-drawer.test.tsx
#	translations/de/web.json
@arielshad arielshad force-pushed the feat/prototype-exploration-mode branch from a5dcc26 to c98e248 Compare April 5, 2026 16:17
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 5, 2026

Dev Release Published

Artifact Version Install
npm 1.170.0-pr513.cff27cb npm install -g @shepai/cli@1.170.0-pr513.cff27cb

Published from commit c98e248 | View CI

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