feat(init): simplify init flow — scope removal, two-step plugin selection, /bug-analysis in WORKFLOW_ORDER#232
Conversation
… selection, /bug-analysis in WORKFLOW_ORDER - Remove interactive installation-scope prompt; user scope is now the default for all TTY interactive runs (--scope flag and non-TTY path unchanged) - Split single plugin multiselect into two sequential steps: Step 1 Workflow plugins (non-optional pre-selected), Step 2 Language plugins (nothing pre-selected) - Bounded retry loop (max 3 attempts) guards against both steps being left empty; graceful cancel after exhaustion - Export WORKFLOW_ORDER from plugins.ts (adds /bug-analysis after /self-review) and import it in init.ts, removing the local duplicate - Add partitionSelectablePlugins() pure helper to plugins.ts with disjoint workflow/language buckets, excluded set applied, no mutation - Add pluginHints for explore, research, release, bug-analysis - New tests: partitionSelectablePlugins (8 cases) + WORKFLOW_ORDER coverage (4 cases, including regression guard for /bug-analysis) Co-Authored-By: Claude <noreply@anthropic.com>
…use partitionSelectablePlugins in stale test Replace push-then-spread accumulators with direct assignment in the bounded selection loop; each step assigns its result directly instead of pushing into a temporary array before combining. Update the audit-claude-is-excluded test to delegate to partitionSelectablePlugins instead of repeating the exclusion filter inline, eliminating the duplicated exclusion set.
|
Redundant After the Fix: Remove the cast—let type narrowing do the work: workflowSelected = step1; // was: step1 as string[]Note: While this cast matches pre-existing convention in the file, the best practice is to remove it (and ideally update similar pre-existing casts in a follow-up). This is a review finding from devflow code-review (9 reviewers). See full analysis at .devflow/docs/reviews/ |
|
Redundant Same issue as above: Fix: languageSelected = step2; // was: step2 as string[]This is a review finding from devflow code-review (9 reviewers). See full analysis at .devflow/docs/reviews/ |
|
Interactive selection loop logic is untested (Testing review, 88% confidence) The bounded retry ( Impact: Three behaviors carry regression risk with zero test coverage:
Fix: Extract a pure reducer like: function combineSelection(
workflowSelected: string[],
languageSelected: string[]
): { plugins: string[]; accepted: boolean } {
const combined = [...workflowSelected, ...languageSelected];
return { plugins: combined, accepted: combined.length > 0 };
}Also extract This is a review finding from devflow code-review (9 reviewers). See full analysis at .devflow/docs/reviews/ |
|
WORKFLOW_ORDER regression guard is directionally asymmetric (Testing review, 82% confidence) This test asserts that every workflow plugin command appears in WORKFLOW_ORDER, but does NOT check the reverse: that every entry in WORKFLOW_ORDER is still a known command. This misses the symmetric case—a stale or typo'd WORKFLOW_ORDER entry that no longer maps to any plugin command would go undetected. Fix: Add a reverse-direction assertion: const allKnownCommands = new Set(
DEVFLOW_PLUGINS.flatMap(p => p.commands)
);
WORKFLOW_ORDER.forEach(cmd => {
expect(allKnownCommands.has(cmd)).toBe(true);
});Together with the existing forward check, this makes the guard bidirectional and catches both dropped commands and stale/renamed entries. This is a review finding from devflow code-review (9 reviewers). See full analysis at .devflow/docs/reviews/ |
Review Summary — All 9 Reviewers APPROVED_WITH_CONDITIONSBlockers: None — merge ready once should-fix items above are addressed. Merge Recommendation: APPROVED_WITH_CONDITIONS (82% confidence overall) Key Strengths
Should-Fix Items (4 inline comments above)
Lower-Confidence Observations (summary format)Architecture clarity (82%, MEDIUM)
Implicit language-bucket contract (80%, LOW)
Test oracle coupling (65-70%, LOW)
All Reviewers
Generated by devflow code-review — [parallel 9-reviewer architecture, complexity, consistency, performance, regression, reliability, security, testing, typescript] |
…rectional WORKFLOW_ORDER guard - Extract pure `combineSelection` and `shouldRetry` functions from the interactive two-step selection loop in init.ts; add unit tests for accept on non-empty combined, empty-both-buckets case, retry exhaustion, and mid-loop iteration (mirrors parsePluginSelection extraction pattern). - Add reverse WORKFLOW_ORDER regression guard in plugins.test.ts: every WORKFLOW_ORDER entry must correspond to a real command in DEVFLOW_PLUGINS (including audit-claude which is excluded from the workflow bucket but legitimately present in the full command set). - Remove redundant `as string[]` casts after @Clack isCancel guards — TypeScript already narrows to string[] after the guard block (avoids PF-005). - Clarify loop body control flow by using `isLastAttempt` local flag; fix pluginHints key order to match WORKFLOW_ORDER (self-review before bug-analysis); extract shared `toChoice` helper to remove duplicate .map bodies; add comment on language-bucket predicate implicit contract (PF-007: source only).
…move the single-use isLastAttempt intermediate variable — the !shouldRetry call is already readable inline and avoids a named double-negative. Condense the shouldRetry JSDoc from 5 lines to 3 to match the brevity of sibling pure-function docs.
Review Cycle 2: All Clear ✓Reviewers: 9/9 approved (security, architecture, performance, complexity, consistency, regression, testing, reliability, typescript) All nine reviewers have completed their analysis with unanimous APPROVED recommendations. No inline comments needed — all code issues have met the acceptance criteria for this PR. Reviewer Scores
Low-Confidence Suggestions (For Author's Optional Consideration)The following items are marked <65% confidence — noted for quality but not blocking: From Architecture (65-62%):
From Complexity (65%):
From Consistency (65%):
From Regression (70%):
From Testing (65-62%):
From TypeScript (65%):
All of the above are stylistic or design-hardening suggestions. Core functionality is solid and all architectural/reliability/security concerns have been addressed. Claude Code | Review Cycle 2 | 2026-06-01 |
…knowledge, design/review docs Persist the shared .devflow/ knowledge base to the branch: - decisions.md / pitfalls.md: accumulated ADR/PF entries - features/hooks/KNOWLEDGE.md: updated feature knowledge - docs/design + docs/reviews: design artifact and review/resolution reports for init-flow-simplification (#232) and remove-ambient-commands-rule (#233) Transient per-developer state (memory/, sidecar/, logs, locks, .last-review-head) remains gitignored. Treats .devflow/ as a shared, committed knowledge base. Co-Authored-By: Claude <noreply@anthropic.com>
Problem Being Solved
Three init-flow rough edges: an unwanted user/local scope prompt, a missing
/bug-analysisentry in the post-install command list, and a single plugin list that conflated workflow and language plugins.Key Changes to Highlight
--scopeflag kept)./bug-analysisnow appears in the "Available commands" note, guarded by a coverage test.partitionSelectablePlugins+ exportedWORKFLOW_ORDER, both unit-tested.Breaking Changes
None for scripted use (
--plugin,--scopeunchanged). Interactive scope choice is removed by design; deep local-scope removal is deferred.Reviewer Focus Areas
isCancelhandling on both new multiselects.partitionSelectablePlugins.