Skip to content

Add setup wizard for missing dependencies #9

Closed

Description

@admarble

Problem

When a user runs `sequant init` without required dependencies (gh, claude), they only discover this later when workflows fail. The init succeeds but the project isn't actually usable.

Proposed Solution

Add an optional setup wizard that:

  1. Checks for required dependencies during init
  2. Offers to guide installation if missing
  3. Can be skipped with `--skip-setup` flag

Wizard Flow

```
sequant init

Checking dependencies...
✗ GitHub CLI (gh) not found
✗ Claude Code CLI not found

Would you like to set up missing dependencies? [Y/n]

Setting up GitHub CLI...
→ Install: brew install gh (macOS) or see https://cli.github.com
→ After install, run: gh auth login

Setting up Claude Code...
→ Install: npm install -g @anthropic-ai/claude-code
→ Or see: https://claude.ai/code

Run 'sequant doctor' after installation to verify.
```

Acceptance Criteria

  • Check dependencies during init
  • Offer guided setup for missing deps
  • Platform-specific install instructions (brew, apt, etc.)
  • Skip option for CI/advanced users
  • Works even if deps are missing (just warns)

Priority

High - significantly improves first-time user experience.

Activity

  1. added
    enhancement
    on Jan 9, 2026
  2. admarble commented on Jan 11, 2026

    @admarble
    ContributorAuthor

    Implementation Plan: Setup Wizard for Missing Dependencies

    Acceptance Criteria Checklist

    • AC-1: Check dependencies during init

      • Verify: Unit test for checkAllDependencies() detecting missing gh/claude
    • AC-2: Offer guided setup for missing deps

      • Verify: Integration test showing wizard prompt and step-by-step instructions
    • AC-3: Platform-specific install instructions

      • Verify: Unit tests for getInstallHint("claude") returning correct commands per platform
    • AC-4: Skip option for CI/advanced users

      • Verify: --skip-setup flag skips wizard; CI env auto-skips
    • AC-5: Works even if deps are missing

      • Verify: Init completes with warnings when wizard declined/skipped

    Implementation Phases

    Phase Description Files
    1 Extend prerequisite checking src/lib/system.ts, src/commands/init.ts
    2 Create wizard module src/lib/wizard.ts (new)
    3 Integrate into init bin/cli.ts, src/commands/init.ts
    4 Update doctor src/commands/doctor.ts
    5 Add tests src/lib/wizard.test.ts, src/commands/init.test.ts

    Key Decisions

    • Wizard pattern: Follows existing inquirer patterns from init.ts
    • Platform detection: Leverages existing getInstallHint() in system.ts
    • Skip mechanism: New --skip-setup flag (distinct from --yes)
    • Dependencies checked: gh (required), claude (required), jq (optional, shown as suggestion)

    Wizard Flow Preview

    sequant init
    
    Checking dependencies...
    ✓ GitHub CLI (gh) - installed and authenticated  
    ✗ Claude Code CLI - not installed
    
    Would you like to set up missing dependencies? [Y/n]
    
    Setting up Claude Code CLI...
    → Install: npm install -g @anthropic-ai/claude-code
    → Docs: https://docs.anthropic.com/en/docs/claude-code
    
    Press Enter when installed, or 's' to skip...
    
    ✓ Claude Code CLI - now installed
    
    Continuing with initialization...
    

    Recommended Workflow

    /exec 9 → /qa 9


    🤖 Generated with Claude Code

  3. added a commit that references this issue on Jan 11, 2026
  4. admarble commented on Jan 11, 2026

    @admarble
    ContributorAuthor

    Progress Update: Setup Wizard Implementation

    AC Coverage Summary

    AC Status Verification
    AC-1: Check dependencies during init ✅ Satisfied checkAllDependencies() in wizard.ts - unit tested
    AC-2: Offer guided setup for missing deps ✅ Satisfied runSetupWizard() prompts user and guides through installation
    AC-3: Platform-specific install instructions ✅ Satisfied getInstallHint() returns brew/apt/choco per platform - unit tested
    AC-4: Skip option for CI/advanced users ✅ Satisfied --skip-setup flag and auto-skip in CI - unit tested
    AC-5: Works even if deps are missing ✅ Satisfied Init completes with warnings when wizard declined/skipped

    Files Changed

    File Changes
    src/lib/wizard.ts New - Wizard module with checkAllDependencies(), displayDependencyStatus(), runSetupWizard(), getInstallInstructions()
    src/lib/wizard.test.ts New - 22 tests for wizard functionality
    bin/cli.ts Added --skip-setup option to init command
    src/commands/init.ts Integrated wizard into init flow
    src/lib/system.ts Added claude to install hints
    src/lib/system.test.ts Added tests for claude install hint
    src/commands/init.test.ts Updated tests for wizard integration

    Checks Run

    • ✅ npm test - 305 tests passed
    • ✅ npm run build - TypeScript compilation successful

    PR Status

    Created: #63

    Next Steps

    Ready for /qa 9 review.


    🤖 Generated with Claude Code

  5. admarble commented on Jan 11, 2026

    @admarble
    ContributorAuthor

    🔍 QA Review Complete (Phase 3)

    AC Coverage

    AC Description Status Notes
    AC-1 Check dependencies during init ✅ MET checkAllDependencies() checks gh, claude, jq - unit tested
    AC-2 Offer guided setup for missing deps ✅ MET runSetupWizard() prompts with "I've installed it - verify now" / "Skip for now"
    AC-3 Platform-specific install instructions ✅ MET getInstallHint() returns brew/apt/choco per platform - unit tested
    AC-4 Skip option for CI/advanced users ✅ MET --skip-setup flag + auto-skip in CI via isCI() check
    AC-5 Works even if deps are missing ✅ MET Init completes with warnings when wizard declined/skipped

    Coverage: 5/5 AC items fully met


    Quality Metrics

    Metric Value Status
    Type issues (any) 0 ✅ OK
    Deleted tests 0 ✅ OK
    Files changed 7 ✅ OK
    Lines added +770 -
    Lines deleted -26 -
    New tests +22 ✅ Excellent coverage

    Code Review

    Strengths:

    • Clean modular architecture with wizard.ts as standalone module
    • Comprehensive test coverage (22 new tests for wizard, updated init.test.ts)
    • Follows existing patterns (inquirer prompts, chalk styling)
    • Proper TypeScript interfaces (DependencyStatus, DependencyCheckResult, WizardResult)
    • gh authentication is checked separately from installation status
    • jq correctly marked as optional (doesn't block allRequiredMet)

    Issues: None blocking

    Suggestions:

    • Consider documenting --skip-setup flag in README (minor, discoverable via --help)
    • Manual testing items in PR still pending (as noted in PR checklist)

    Verdict: ✅ READY_FOR_MERGE

    All acceptance criteria are fully met with excellent test coverage. The implementation follows existing patterns and provides a significantly improved first-time user experience.

    Documentation

    • README updated (if new feature/flag) - Minor gap, --skip-setup not documented
    • docs/ updated (if behavior changed) - N/A
    • CHANGELOG entry added (for user-facing changes) - Pending for release
    • N/A - Core behavior well-tested, flag discoverable via --help

    Next Steps

    1. ✅ Merge when ready - all automated checks pass
    2. Optional: Add --skip-setup to README init command documentation
    3. Run /docs 9 before merge if admin-facing documentation needed

    🤖 Generated with Claude Code /qa

  6. added
    ready-for-review
    on Jan 11, 2026
  7. added a commit that references this issue on Jan 11, 2026
  8. admarble commented on Jan 11, 2026

    @admarble
    ContributorAuthor

    🔧 A+ Improvements Applied

    Changes Made

    Improvement File Description
    Security fix system.ts Added input validation to commandExists() - rejects shell metacharacters
    Error handling wizard.ts Wrapped inquirer prompts in try-catch for graceful degradation
    Test coverage wizard.test.ts Added multi-dep flow and verify-failure scenarios (+2 tests)
    Security tests system.test.ts Added injection prevention tests (+2 tests)

    Quality Metrics (Updated)

    Metric Before After
    Tests 305 309
    Type issues 0 0
    Security issues 1 CRITICAL (mitigated) 0

    Verification

    ✓ 309 tests passing
    ✓ Build successful
    ✓ Security hardening complete
    

    Updated Verdict: ✅ A+ READY_FOR_MERGE

    All security concerns addressed. Test coverage improved. Error handling added for edge cases.


    🤖 Generated with Claude Code

  9. added 2 commits that reference this issue on Jun 22, 2026
  10. added 2 commits that reference this issue on Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementready-for-review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions