Skip to content

feat(init): add luca init command to scaffold a new spec file#84

Merged
albertodebortoli merged 2 commits into
mainfrom
feature/init-command
May 25, 2026
Merged

feat(init): add luca init command to scaffold a new spec file#84
albertodebortoli merged 2 commits into
mainfrom
feature/init-command

Conversation

@albertodebortoli
Copy link
Copy Markdown
Member

@albertodebortoli albertodebortoli commented May 25, 2026

Description

  • Introduces an interactive luca init command that guides the user through creating a new spec file (Lucafile, Toolfile, or Skillfile) in either the current project directory or the global config location (~/.config/luca/).
  • Uses Noora prompts for both location and filename selection, and asks for confirmation before overwriting an existing file.
  • Business logic extracted into a new SpecInitializer component in LucaCore (testable, DI-friendly), keeping InitCommand as a thin interactive wrapper.
  • Template includes commented examples for repos:, tools:, and skills: sections.

Type of Change

  • Feature

How Has This Been Tested?

  • Added / updated unit tests
  • Manually tested locally (describe)
  • Tested on macOS (arch: arm64)

12 Swift Testing tests in SpecInitializerTests cover:

  • Local and global file creation
  • Parent directory creation for the global path
  • Template content written to disk
  • fileAlreadyExists error when overwrite is false
  • Overwrite behaviour
  • All three spec filenames via @Test(arguments:)
  • Template key presence (repos:, tools:, skills:)
swift build   # ✓
swift test    # ✓ 480 tests passed

Checklist

  • Swift code builds locally (swift build)
  • Tests pass locally (swift test)
  • Code style / formatting respected
  • Documentation updated (README / comments)

Breaking Changes?

  • No

Introduces `luca init`, an interactive command that asks the user where
to create the spec file (current directory or global ~/.config/luca/)
and what to name it (Lucafile, Toolfile, or Skillfile). The file is
written with a commented YAML template via the new `SpecInitializer`
component in LucaCore, which is fully covered by Swift Testing tests.
@albertodebortoli albertodebortoli added this to the 0.19.0 milestone May 25, 2026
@albertodebortoli albertodebortoli added the feature New feature or enhancement label May 25, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@albertodebortoli albertodebortoli marked this pull request as ready for review May 25, 2026 21:15
@albertodebortoli albertodebortoli merged commit 4e8fab6 into main May 25, 2026
3 checks passed
@albertodebortoli albertodebortoli deleted the feature/init-command branch May 25, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant