Skip to content

bug: ddx init missing --workflow flag documented in README #24

@mehdipiraee

Description

@mehdipiraee

Summary

The ddx init --workflow helix command fails with "unknown flag: --workflow" error, despite being documented in the README.

Problem

The README shows this as a supported initialization option:

# Initialize with a template
ddx init --template nextjs-enterprise

# Apply your team's standards  
ddx patterns apply team-standards

And later references workflow initialization:

# Initialize HELIX in your project
ddx workflows apply helix

However, trying to initialize with a workflow directly fails:

$ ddx init --workflow helix
Error: unknown flag: --workflow

Current vs Expected Behavior

Current:

$ ddx init --help | grep workflow
# No workflow flag shown

$ ddx init --workflow helix  
Error: unknown flag: --workflow

Expected:

$ ddx init --workflow helix
🚀 Initializing DDx with HELIX workflow...
✅ HELIX workflow initialized successfully!

Root Cause Analysis

Looking at cli/cmd/init.go, the available flags are:

cmd.Flags().StringP("template", "t", "", "Use specific template")
cmd.Flags().BoolP("force", "f", false, "Force initialization even if DDx already exists")  
cmd.Flags().Bool("no-git", false, "Skip git subtree setup")

The --workflow flag is missing from the implementation.

Documentation References

The README mentions workflow initialization in multiple places:

  1. HELIX Workflow section:

    # Initialize HELIX in your project
    ddx workflows apply helix
  2. Workflow: Structured Methodologies section:

    # Apply your organization's workflow
    ddx workflows apply company-sdlc

This suggests workflows can be applied, but the README implies ddx init --workflow should also work for direct initialization.

Expected Implementation

Add --workflow flag to ddx init command:

// In cli/cmd/init.go or cli/cmd/command_factory_commands.go
cmd.Flags().StringP("workflow", "w", "", "Initialize with specific workflow (e.g., helix)")

The flag should:

  1. Initialize DDx normally (.ddx.yml, directory structure)
  2. Apply the specified workflow automatically
  3. Set up workflow-specific configuration

Alternative Solutions

If --workflow flag is not intended, the README should be updated to clarify:

Option 1: Two-step process (current working method)

ddx init
ddx workflow apply helix  # or ddx workflows apply helix

Option 2: Single command with workflow flag (desired)

ddx init --workflow helix

User Impact

Current Workaround:

ddx init
ddx workflow apply helix  # User must remember second step

With Fix:

ddx init --workflow helix  # Single command as documented

Acceptance Criteria

  • ddx init --help shows --workflow flag
  • ddx init --workflow helix works without errors
  • Workflow initialization includes standard ddx init plus workflow setup
  • Error handling for invalid workflow names
  • Integration with existing workflow commands
  • Update documentation if different approach is chosen

Related Commands

  • ddx workflow apply <name> - Apply workflow to existing DDx project
  • ddx workflows list - List available workflows
  • ddx init --template <name> - Similar pattern for templates

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions