Skip to content

fix(adf): adf init --module <name> should be additive when .ai/ exists #5

@SmartBrandStrategies

Description

@SmartBrandStrategies

Summary

charter adf init --module frontend fails with a misleading message when .ai/ already exists:

.ai/ already exists at .ai/
Use --force (or --yes) to overwrite.

The --module flag implies adding a single module to the existing directory, but the command treats it as a full re-initialization. Using --yes works but regenerates all files (manifest.adf, core.adf, state.adf) — potentially overwriting customized content.

Steps to Reproduce

charter bootstrap --yes          # creates .ai/ with core.adf, state.adf, manifest.adf
# customize core.adf ...
charter adf init --module frontend   # fails
charter adf init --module frontend --yes  # works but regenerates everything

Expected Behavior

adf init --module <name> with an existing .ai/ directory should:

  1. Create only the specified module file if it doesn't exist
  2. Register it in the manifest if not already listed
  3. Leave all other files untouched

Actual Behavior

  • Without --yes: fails entirely with "already exists" error
  • With --yes: recreates all ADF files, potentially losing customizations to core.adf

Suggested Fix

Separate the "add a single module" path from the "initialize entire ADF directory" path. When --module is specified and .ai/ exists, operate additively on just that module.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions