Skip to content

Empty folders #269

Closed
Closed

Description

@ravshansbox

TLDR: we need to add .gitkeep to every empty folder openspec creates

After initialising the openspec, it creates:

  • openspec/changes
  • openspec/changes/archive
  • openspec/specs

And if you try immediately commit the changes and someone fetches the repo, these folders are absent and openspec list command recommends openspec init. Even if you init once again those folders are not recreated.

Activity

  1. TabishB commented on Nov 3, 2025

    @TabishB
    Contributor

    @ravshansbox Ahaha yeah I didn't think about this edge case. I'll take a look.

  2. yha9806 commented on Nov 5, 2025

    @yha9806

    Hi! I'd like to work on this issue.

    Problem: Git doesn't track empty directories, so the specs/, changes/, and changes/archive/ folders created by openspec init disappear after commit, breaking the workflow for new team members.

    Solution: Add .gitkeep files to these three directories to ensure Git tracks them.

    Approach:

    1. Modify src/core/init.ts createDirectoryStructure method to create .gitkeep files
    2. Add test cases to verify .gitkeep presence
    3. Ensure openspec list works immediately after clone

    OpenSpec Proposal: I've created a proposal following the OpenSpec framework: add-gitkeep-empty-folders

    I'll submit a PR shortly. Thanks!

  3. added a commit that references this issue on Mar 1, 2026
    fe05f46
  4. Br1an67 commented on Mar 1, 2026

    @Br1an67
    Contributor

    I'd like to work on this. The fix adds .gitkeep files to the specs/, changes/, and changes/archive/ directories during init so they are preserved in version control.

    PR: #786

  5. added a commit that references this issue on Mar 2, 2026
    24b56d9
  6. added a commit that references this issue on Aug 7, 2026
    ee574b1
  7. clay-good commented on Aug 7, 2026

    @clay-good
    Collaborator

    Reopening: this is a confirmed bug (acknowledged above) and still reproduces on main for openspec init — the empty specs/, changes/, and changes/archive/ directories are untracked, so they vanish on clone and openspec list recommends re-init. The live fix is #786 (adds .gitkeep anchors during init). Reopening so that merging #786 auto-closes this.

  8. added a commit that references this issue on Sep 2, 2026
    0296401
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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