Skip to content

bug: ddx init does not create required .ddx directory structure #20

Description

@mehdipiraee

Bug Description

ddx init creates .ddx.yml configuration file but does not create the required .ddx/ directory structure, causing all subsequent DDx commands to fail with "not initialized" errors.

Expected .ddx/ Structure

According to the README "Local-First Architecture" section, ddx init should create:

your-project/
├── .ddx/
│   ├── prompts/        # AI prompts and instructions
│   ├── templates/      # Project and file templates
│   ├── patterns/       # Reusable code patterns
│   └── configs/        # Tool configurations
├── src/                # Your application code
└── .ddx.yml           # DDX configuration

Current Behavior

After ddx init:

  • .ddx.yml is created
  • .ddx/ directory is NOT created
  • ❌ Required subdirectories (prompts/, templates/, patterns/, configs/) are missing

Impact

All commands that use isInitialized() fail because they check for .ddx/ directory:

func isInitialized() bool {
    _, err := os.Stat(".ddx")
    return err == nil
}

Failing commands:

  • ddx update → "❌ Not in a DDx project. Run 'ddx init' first."
  • ddx contribute → "❌ Not in a DDx project. Run 'ddx init' first."
  • ddx rollback → "project is not initialized with DDx. Run 'ddx init' first"
  • ddx diagnose → Shows "Initialization: ✗ Not initialized"

Steps to Reproduce

  1. Run ddx init in a clean project directory
  2. Verify .ddx.yml exists ✅
  3. Check for .ddx/ directory ❌ (missing)
  4. Run ddx diagnose → incorrect "not initialized" status
  5. Run ddx update → fails with "not initialized" error

Root Cause

The init.go file has a comment indicating it should create the directory:

// Always create .ddx directory (required for isInitialized check)
localDDxPath := ".ddx"
if err := os.MkdirAll(localDDxPath, 0755); err != nil {

But this code path may not be executing correctly or the directory creation is failing silently.

Proposed Fix

ddx init should create the complete directory structure:

mkdir -p .ddx/prompts
mkdir -p .ddx/templates  
mkdir -p .ddx/patterns
mkdir -p .ddx/configs

Environment

  • DDx version: Latest from easel/ddx repository
  • OS: macOS
  • Installation: Built from source

Workaround

Manual directory creation allows commands to work:

mkdir -p .ddx
ddx update  # Now works

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions