Decompose the wizard store + session into composable, program-defined slices
维护者通常 2 天内回复
@gewenyu99 已经在做这个了。
开始于 2026年6月30日。
评估
这个 Issue 还没有评估数据。
描述
Problem
The global WizardSession and the TUI store have become a catch-all. Every program's state lives flat on one shared object, so the core keeps growing and infrastructure code carries product knowledge it shouldn't.
Today:
src/lib/wizard-session.ts— 404 lines, ~164 fields/members on the session interface.src/ui/tui/store.ts— 944 lines, 29 explicit setters (each must remember to callemitChange()).- Program-specific state is flat on the shared session regardless of which program is running, e.g.
mcpComplete/mcpOutcome/mcpInstalledClients/mcpSuggestedPromptsDismissed,slackStepDismissed/slackConnected,skillsComplete/skillId, … These exist on the session for anauditorrevenue-analyticsrun that never touches MCP or Slack.
This violates the repo's own design discipline (AGENTS.md: product knowledge never enters infrastructure code). The store/session are machinery, but they currently know about MCP, Slack, skills, etc. Adding a program means widening the shared session and adding setters to the shared store — the bloat compounds.
Goal
Make the store and session composable and driven by program definitions (src/lib/programs/), so:
- The core session holds only program-agnostic state (install dir, credentials, detected framework, run phase, current screen).
- Each program contributes its own typed state slice (e.g.
mcp,slack,skills) declared alongside its program definition, mounted only when that program runs. - The store composes setters/selectors from the active program's slices instead of hardcoding all 29.
- Screens read/write their program's slice, not a flat global.
Sketch (not prescriptive)
- A program definition declares an optional
state: { initial, setters }slice with a typed shape. buildSession()composes core + the active program's slices; the store derives its setter surface from them (soemitChange()is wired once, generically).- Migrate the obvious clusters first:
mcp*,slack*,skill*→ owned by the programs that use them.
Acceptance criteria
- Core
WizardSessionno longer references program-specific concepts (MCP/Slack/skills/etc.). - At least the MCP, Slack, and skills state are program-owned slices, mounted only for programs that declare them.
- Store setter/selector surface is composed from active slices, not a flat hardcoded list;
emitChange()stays centralized. - Adding a new program needs no edits to the core session/store — only its own definition + slice.
-
pnpm build && pnpm testgreen; router/screen-resolution behavior unchanged.
Notes
- Read
.claude/skills/wizard-development/SKILL.md+references/ARCHITECTURE.mdfirst — this is a structural change to the pipeline's core. - Keep the nanostore single-shallow-copy + explicit-setter invariant; the change is about where slices are defined and composed, not how mutation/emit works.
- 主要语言
- TypeScript
- 星标
- 208
- 派生
- 58
- 平均合并
- 2 天 7 小时
- 30 天内合并 PR
- 76
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
PostHog/wizard 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 2 天内回复
-
wizard --version prints unknown when run through npx可能已有人在做 @bryanlundberg 于 3 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 2 天内回复
-
Self-driving setup: checkbox labels and Confirm button overlap wrapped description text可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复
相似的 Issue
-
bug Needs Triage
难度 2/5 1-3 小时 新手友好度 79/100
scottbenton/Iron-Link#541 ·
维护者通常 1 天内回复
-
hosts settings: the SSH address field and the separate User field are two ways to name one SSH user未关闭
难度 2/5 1-3 小时 新手友好度 72/100
prime-radiant-inc/evener#8161 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
nicobailon/pi-subagents#3420 ·
维护者通常 1 天内回复
-
Edit content TabList: selected tab's icon/label are hidden by its own selection indicator - a11y未关闭01 type: bug 99 tag: UX Accessibility
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 2 天内回复