Files
2025-08-05 23:15:13 +10:00

1.3 KiB

Implementation Tasks for Init Command

1. Core Infrastructure

  • 1.1 Create src/utils/file-system.ts with directory/file creation utilities
  • 1.2 Create src/core/templates/index.ts for template management
  • 1.3 Create src/core/init.ts with main initialization logic

2. Template Files

  • 2.1 Create src/core/templates/readme-template.ts with OpenSpec README content
  • 2.2 Create src/core/templates/project-template.ts with customizable project.md
  • 2.3 Create src/core/templates/gitignore-template.ts for OpenSpec-specific ignores

3. Init Command Implementation

  • 3.1 Add init command to src/cli/index.ts using Commander
  • 3.2 Implement interactive prompts for project information
  • 3.3 Add validation for existing OpenSpec directories
  • 3.4 Implement directory structure creation logic
  • 3.5 Implement file generation with templates

4. User Experience

  • 4.1 Add colorful console output for better UX
  • 4.2 Implement progress indicators during creation
  • 4.3 Add success message with next steps
  • 4.4 Add error handling with helpful messages

5. Testing and Documentation

  • 5.1 Add unit tests for file system utilities
  • 5.2 Add integration tests for init command
  • 5.3 Update package.json with proper bin configuration
  • 5.4 Test the built CLI command end-to-end